Answer the question
In order to leave comments, you need to log in
How does this script work?
I found a vbs script on the Internet to reboot a 4g modem via telnet.
And at the end of the script there are these lines:
WScript.Sleep 3500
ProcessClose("cmd.exe")
ProcessClose("telnet.exe")
Function ProcessClose(sProcName)
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery("Select * from Win32_Process Where Name = '" & sProcName & "'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
End Function
Answer the question
In order to leave comments, you need to log in
At the end, using WMI , a process with the name in the sProcName variable is searched (using SQL karl!)
Why is the full path with the computer name strComputer indicated there, I don’t know, is it really necessary to look for others on the network?
Then processes with that name are killed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question