• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Check if a .exe program is running

Engaged ,
Mar 16, 2022 Mar 16, 2022

Copy link to clipboard

Copied

Hello everyone, everything good?
How do I check if the application (.exe ) is running through script? Thanks in advance.

TOPICS
Actions and scripting

Views

347

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

People's Champ , Mar 16, 2022 Mar 16, 2022

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

Votes

Translate

Translate
Adobe
LEGEND ,
Mar 16, 2022 Mar 16, 2022

Copy link to clipboard

Copied

You can check process identificator (pid) with .vbs. Just google it yourself 😉

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 16, 2022 Mar 16, 2022

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.

Captura de tela 2022-03-16 102649.jpg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 16, 2022 Mar 16, 2022

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Mar 16, 2022 Mar 16, 2022

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 16, 2022 Mar 16, 2022

Copy link to clipboard

Copied

LATEST

Hi @r-bin, here in the latest version of photoshop/W10 it worked perfectly fine. great. Thanks for sharing.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines