Jump to content
Macro Express Forums

Terminate Process command: odd behaviour


Recommended Posts

Here's an ultra-simple example. Open Notepad and run the following macro

Terminate Process: NOTEPAD.EXE

That works fine, closing Notepad.

 

Now change the macro to the full path, the method used in the Help example :

Terminate Process: C:\WINDOWS\NOTEPAD.EXE

 

That fails here. There's some fleeting activity, but Notepad remains open.

 

And after the macro stops, there's this baffling error message in Script Editor:

"Line 1: Debug Error: The Process is not running"

when it plainly is (as shown in Task Manager, apart from the prominence of the Notepad window itself.)

 

Anyone able to confirm please?

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Terminate Process: C:\WINDOWS\NOTEPAD.EXE[/b]

Once a program is running in memory all file path information about that program is meaningless. The 'C:\WINDOWS\' is only used to launch the program 'Notepad.exe'. The only way this program is referenced inside Windows as it is running is 'Notepad.exe'.

Link to comment
Share on other sites

Once a program is running in memory all file path information about that program is meaningless. The 'C:\WINDOWS\' is only used to launch the program 'Notepad.exe'. The only way this program is referenced inside Windows as it is running is 'Notepad.exe'.

 

So is the example in Help a mistake?

 

And if I wanted to terminate a different program, D:\Program Files\Notepad.exe, how would ME Pro distinguish the two?

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Looks like another error in the help file......................................

Ha! I never noticed that before, the graphic in the help file does show a complete path. You should write it up in a bugrep.

 

What Kevin says is correct. The simplest way to see this is to go to the Task Manager and select the Processes tab. You want what appears in the "Image Name" column.

Link to comment
Share on other sites

Looks like another error in the help file......................................

Ha! I never noticed that before, the graphic in the help file does show a complete path. You should write it up in a bugrep.

 

What Kevin says is correct. The simplest way to see this is to go to the Task Manager and select the Processes tab. You want what appears in the "Image Name" column.

 

Thanks for checking and confirming.

 

Any thoughts on my second point about distinguishing Path1\xyz.exe from Path2\xyz.exe? That's why I would have thought the path was necessary to avoid ambiguity.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Any thoughts on my second point about distinguishing Path1\xyz.exe from Path2\xyz.exe? That's why I would have thought the path was necessary to avoid ambiguity.

When you start a process, the system needs to know which process you want to start, so you specify the path in order to avoid any ambiguity.

Once the process is running, there's no ambiguity any more because each process has a unique Id (PID). So you may have several processes running, all called xyz.exe. If you use Task Manager to kill one of these processes, you must manually select which process you mean. If you use a Kill utility, you'd use a PID, otherwise you'd likely kill all processes with that name (that's how PsKill works).

With ME, you can specify a window name. If you use the process name instead, one of the named processes is terminated; I don't know if it's the first process found, or the first process started, or whatever. But the path used when starting the process is completely irrelevant to Windows.

Link to comment
Share on other sites

  • 1 year later...

Okay, I am having this problem as well. I seek to terminate a running process. I am using just the process name (not the image path). I can clearly see the process in my task manager. However, when I run the macro it gives me an error message "The process is not running". But I can that it is running. How do I enable Macro express to kill this process?

Link to comment
Share on other sites

Works for me. Make sure in the drop down you have selected the option "Process Name" and not "Window Title". If it still does it create a simple macro and just put in that one command and do a debug run (F9) on it and look at the messages pane in the bottom. What error did it give?

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...