au3scr Posted October 31, 2008 Share Posted October 31, 2008 (edited) $line = "intPID = "&@AutoItPID&" ' PID of the process to terminate "&@CRLF&'strComputer = "."'&@CRLF&'set objWMIProcess = GetObject("winmgmts:\\" & strComputer & _'&@CRLF& Chr(34)&"\root\cimv2:Win32_Process.Handle='"&Chr(34)&" & intPID & "&Chr(34)&"'&"&chr(34)&@CRLF&"intRC = objWMIProcess.Terminate()") here is original text: intPID = 2600 ' PID of the process to terminate strComputer = "." ' ------ END CONFIGURATION --------- set objWMIProcess = GetObject("winmgmts:\\" & strComputer & _ "\root\cimv2:Win32_Process.Handle='" & intPID & "'") intRC = objWMIProcess.Terminate() Edit: Oh i got it for now. i had 1 exta ) Edited October 31, 2008 by au3scr Link to comment Share on other sites More sharing options...
FaT3oYCG Posted October 31, 2008 Share Posted October 31, 2008 what you mean how do you get this:intPID = 2600 ' PID of the process to terminatestrComputer = "."' ------ END CONFIGURATION ---------set objWMIProcess = GetObject("winmgmts:\\" & strComputer & _"\root\cimv2:Win32_Process.Handle='" & intPID & "'")intRC = objWMIProcess.Terminate()to be on one line?if that is the case remove all of the & @CRLF sections from the code. Interpreters have great power!Although they live in the shadow of compiled programming languages an interpreter can do anything that a compiled language can do, you just have to code it right. Link to comment Share on other sites More sharing options...
au3scr Posted October 31, 2008 Author Share Posted October 31, 2008 (edited) $line = "intPID = " & @AutoItPID &" ' PID of the process to terminate " & @CRLF & 'strComputer = "."' & @CRLF & 'set objWMIProcess = GetObject("winmgmts:\\" & strComputer & _' & @CRLF & Chr(34) & "\root\cimv2:Win32_Process.Handle='" & Chr(34) & " & intPID & " & Chr(34) & "'" & chr(34) & ")" & @CRLF & "intRC = objWMIProcess.Terminate()" FileDelete(@ScriptDir&"\react.vbs") FileWrite(@ScriptDir&"\react.vbs",$line) Now it is what i need, i need it to restart script. Edited October 31, 2008 by au3scr 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