Copy link to clipboard
Copied
Hello everyone, everything good?
How do I check if the application (.exe ) is running through script? Thanks in advance.
checked on win7 cs6
var exe_name = "Roland VersaWorks.exe"
var tmp_name = "tmp.tmp"
system("tasklist >%TEMP%/"+tmp_name)
var file = new File(Folder.temp.fsName + "/" + tmp_name);
file.open("r");
var s = file.read();
file.close();
file.remove();
if (s.search(new RegExp(exe_name, "i")) >= 0)
alert(exe_name + " is running")
else
alert(exe_name + " is not running")
Copy link to clipboard
Copied
You can check process identificator (pid) with .vbs. Just google it yourself 😉
Copy link to clipboard
Copied
Hi @Kukurykus ! I have a very complex script exporting in batch after performing some adjustments on images which then opens the "Roland VersaWorks.exe" printing software whenever it is executed, however, the problem is that if it is already is running, shows an unwanted message. My objective is to check if "Roland VersaWorks.exe" is already running, if it's true, don't run it again.
I tried to follow your advice and googled it, but I confess I was not able to understand any of this language.
Copy link to clipboard
Copied
You should type in google same phrase like how to check pid vbs. When you know it you can remove process by command prompt using system() method or still by .vbscript.
Copy link to clipboard
Copied
checked on win7 cs6
var exe_name = "Roland VersaWorks.exe"
var tmp_name = "tmp.tmp"
system("tasklist >%TEMP%/"+tmp_name)
var file = new File(Folder.temp.fsName + "/" + tmp_name);
file.open("r");
var s = file.read();
file.close();
file.remove();
if (s.search(new RegExp(exe_name, "i")) >= 0)
alert(exe_name + " is running")
else
alert(exe_name + " is not running")
Copy link to clipboard
Copied
Hi @r-bin, here in the latest version of photoshop/W10 it worked perfectly fine. great. Thanks for sharing.