Jump to content

I cant find mistake


au3scr
 Share

Recommended Posts

$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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

$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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...