JeffQOOQAAA Posted March 16, 2017 Share Posted March 16, 2017 Dear All. I have one question need everyone help I have two computer, One is a server, another is Client Server use Autoit and command line is there Execute via CMD on server Run("cmd.exe", "" , @SW_SHOWMAXIMIZED) Winwaitactive("administrator: c:\windows\system32\cmd.exe", "", 1) Send('cd PSTools' & "{Enter}") Send("psexec -u domain\" & $Username & "{SPACE}" & " -p 123 \\" & $Computername & "{SPACE}" & "-d -i -f -c C:\cmd.bat" & "{Enter}") Send('pause' & "{Enter}") It have processID on client computer, but I want to use Processwaitclose($PID) to deceted on server side How to do this? Link to comment Share on other sites More sharing options...
JeffQOOQAAA Posted March 17, 2017 Author Share Posted March 17, 2017 Have someone can help this? Link to comment Share on other sites More sharing options...
JeffQOOQAAA Posted March 21, 2017 Author Share Posted March 21, 2017 Who can help me? thanks! Link to comment Share on other sites More sharing options...
spudw2k Posted March 22, 2017 Share Posted March 22, 2017 A clarification and a critique: The PID in question....that is the PID of the process started on the Client via PSEXEC? You can't use ProcessClose on the Server to kill a process on the Client. Not sure what your BAT file is doing, but ProcessClose can only close processes on the machine AutoIt is executing. Critique/Suggestion: There's no need to launch a command prompt and send keystrokes to it, not to mention it's one more thing that could go wrong. Just execute the PSEXEC line directly (just my two cents) ;untested $strPSToolsPath = "C:\PSTools" $strExecCMD = '"' & $strPSToolsPath & '\psexec.exe" -u domain\' & $Username & " -p 123 \\" & $Computername & " -d -i -f -c C:\cmd.bat" Run(@ComSpec & " /k " & $strExecCMD , "" , @SW_SHOWMAXIMIZED) Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now