Check whether process is running JS and run?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
9 views
Help to finalize the script

var Process = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery("Select * from Win32_Process Where Name = 'notepad.exe'");
if ( Process.Count < 1 )
{
new ActiveXObject("WScript.Shell").Exec("notepad.exe");
}

In this script it checks if the process is running Notepad , if not then starts.
The question how to specify the path correctly? need for example way C:\\123\\1.bat that would be checked running or not.
Tell me how the correct way to specify
by | 9 views

1 Answer

0 like 0 dislike
Let's see what occurs to you ExecutablePath in this request.
by

Related questions

0 like 0 dislike
1 answer
asked May 21, 2019 by raingo
0 like 0 dislike
2 answers
0 like 0 dislike
6 answers
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
35,430 users