Jump to content
Sign in to follow this  
au3scr

I cant find mistake

Recommended Posts

au3scr

$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 by au3scr

Share this post


Link to post
Share on other sites
FaT3oYCG

what you mean how do you get this:

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()

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.

Share this post


Link to post
Share on other sites
au3scr

$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. :mellow:

Edited by au3scr

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×