Acrobat Reader continues to run in the background

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Kwhiz
Junior Coder
Posts: 35
Joined: Wed Jan 12, 2005 6:19 pm

Acrobat Reader continues to run in the background

Post by Kwhiz » Tue Aug 15, 2006 8:19 pm

Hi,

If I open a .pdf file in my browser, and then close my browser, AcroRead32.exe continues to run in the background. I can make it stop by opening up Task Manager, and going to the Processes tab and making it stop that way. But I would prefer to use a hotkey since it happens a little more frequently than I would like.

I'm trying to figure out how to write a macro that would make the process stop. I don't see a command that would perform this trick. Does anyone have any ideas?

Thanks,
Kwhiz

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Aug 15, 2006 8:41 pm

There are a number of utilities that use a "KILL" function. Some versions of Windows already have this.

You will get many suggestions for a KILL utility here.
My personal choice is PrcView, a freeware program. It is a Windows program but has command line capabilities. You can use the command lines in Macro Scheduler.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
JRL
Automation Wizard
Posts: 3505
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Aug 15, 2006 9:12 pm

Bob's right, I've also seen several third party solutions mentioned in this forum. There is also a VBscript that Marcus posted that would probably do the trick and wouldn't require other software.

Scripts and Tips > Terminating Processes and Stopping Services
http://www.mjtnet.com/forum/viewtopic.php?t=1779

Later,
Dick

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Aug 15, 2006 9:13 pm

See this post for a function to kill a process:
http://www.mjtnet.com/forum/viewtopic.php?t=1779

If you don't know the process name, you can use GetWindowProcess to receive the process name and ID of a window.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Kwhiz
Junior Coder
Posts: 35
Joined: Wed Jan 12, 2005 6:19 pm

Post by Kwhiz » Wed Aug 16, 2006 12:23 am

Damn, I wish I knew VB!! Looking at your script, I'm at a loss as to where to insert AcroRd32.exe in order to get this script to work for me. Can anyone help?

All I want to do is hit a hotkey, and have AcroRd32.exe terminated from my TaskManager Processes tab. It looks like your VB script will work, but I'm not sure how to change it to suit my needs.

Thanks for everyone's help so far, although VB is all Greek to me,
KWhiz

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Aug 16, 2006 1:08 am

You want this:

Code: Select all

VBSTART
Sub killProcess(pgm)
  set wmi = getobject("winmgmts:")
  sQuery = "select * from win32_process " & "where name='" & pgm & "'"
  set processes = wmi.execquery(sQuery)
  for each process in processes
    process.terminate
  next
End Sub
VBEND

VBRun>KillProcess,AcroRd32.exe
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Kwhiz
Junior Coder
Posts: 35
Joined: Wed Jan 12, 2005 6:19 pm

Post by Kwhiz » Wed Aug 16, 2006 11:11 am

Well you certainly made that look relatively easy (and painless), and it works beautifully too! Thanks so much,
KWhiz

Kwhiz
Junior Coder
Posts: 35
Joined: Wed Jan 12, 2005 6:19 pm

Post by Kwhiz » Tue Oct 31, 2006 2:05 am

Hi,

I have a new task-manager process that is running and doesn't seem to get killed with your VBScript code above. The name of the process is PurgeIE_Service. It continues to run even after I close the main program (called PurgeIE). This process does not end in .exe on the task manager, like most of the other processes. I tried changing the last line of your VBScript as follows, but it didn't work:

Your version for Acrobat reader (last line of VBScript code above):
VBRun>KillProcess,AcroRd32.exe

My version for PurgeIE_Service
VBRun>KillProcess,PurgeIE_Service

I also tried adding .exe to the end of the command, but it didn't work either.
Any suggestions??
Thanks,
KWhiz

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Oct 31, 2006 7:47 am

From its name it sounds like it might be a service. In which case just try stopping it. Have a look in Control Panel/Administrative Tools/Services and see if there is a service with a similar name running. You can stop it there.

If you want Macro Scheduler to stop running services you can just use:

Run>Net Stop ServiceName

Or there's some VBScript code here:
http://www.mjtnet.com/forum/viewtopic.php?t=1779
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Kwhiz
Junior Coder
Posts: 35
Joined: Wed Jan 12, 2005 6:19 pm

Post by Kwhiz » Tue Oct 31, 2006 1:28 pm

Thanks. I tried this:

Run>Net Stop PurgeIE_Service

But it didn't work. I also tried this (note the last line), but it didn't work either.

VBSTART
Sub killProcess(pgm)
set wmi = getobject("winmgmts:")
sQuery = "select * from win32_process " & "where name='" & pgm & "'"
set processes = wmi.execquery(sQuery)
for each process in processes
process.terminate
next
End Sub

Sub StopService(sServiceName)
strComputer = "."
Set wbemServices = GetObject("winmgmts:\\" & strComputer)
sWQL = "Select state from Win32_Service " & "Where displayname='" & sServiceName & "'"
Set oResults = wbemServices.ExecQuery(sWQL)
For Each oService In oResults
If Trim(LCase(oService.State)) = LCase("Running") Then
oService.StopService
End If
Next
End Sub
VBENDVBRun>StopService,PurgeIE_Service



However, the good news (sort of), is that I can stop the service via Control Panel/Administrative/Services. So thank you for that! But I don't really understand why neither of your macros is working for me. Am I spelling the service wrong or something? That's exactly the way it appears in the TaskManager. Hmmm.

Thanks again,
Kwhiz

User avatar
JRL
Automation Wizard
Posts: 3505
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Oct 31, 2006 2:22 pm

If you're running XP have you tried "taskkill"?

Code: Select all

Let>RP_WAIT=1
Run>cmd /c taskkill /IM PurgeIE_Service /f > %TEMP_DIR%~killresult~.txt
Readfile>%TEMP_DIR%~killresult~.txt,resultfile
MDL>%resultfile%

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Oct 31, 2006 2:30 pm

Kwhiz wrote:Am I spelling the service wrong or something? That's exactly the way it appears in the TaskManager. Hmmm.
Yes, sounds like it. The service is name is NOT necessarily the same as it's process name.

To determine the service name (for use with Net Stop or the code I provided) go into Control Panel/Administrative Tools/Services and locate the service. Right click on the service and select properties. The service name is given at the top of the properties dialog. That's the name you need to use with Net Stop or in the VBScript code provided.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Tue Oct 31, 2006 4:46 pm

Kwhiz wrote:Hi,

I have a new task-manager process that is running and doesn't seem to get killed with your VBScript code above. The name of the process is PurgeIE_Service. It continues to run even after I close the main program (called PurgeIE).
Hi Kwhiz,

Googling "PurgeIE_Service" found this link which identifies PurgeIE_Service.exe as belonging to a Firefox extension called PurgeFox... did you install that recently? If so, you could uninstall the misbehaving extension and look for another solution and/or report the problem at the PurgeFox website... maybe they'll fix it.

Just a thought.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

KWiz
Junior Coder
Posts: 30
Joined: Sat Oct 07, 2006 1:43 pm

Post by KWiz » Thu Nov 09, 2006 12:57 pm

Just wanted to thank you guys for all your help. I found out from the PurgeIE guys that PurgeIE_Service needs to run in the background as a service if I wish to purge the AutoComplete forms when purging my computer. PurgeIE is a shareware program that purges many things for you, including Temp folders, History folders, AutoComplete forms, Typed URL's, Visited URL's, Cache's, etc. You can disable any feature that you want, and if you disable the "purge autocomplete forms" feature, then the service will not run in the background. They claim this service is not spyware, and I decided to go ahead and trust them on this one. :!:

I'm still unsure as to why I couldn't get MacroScheduler to stop the service with the VBScript code above. I was using the correct spelling. But really I guess it's no big deal anymore since I found the answer I was looking for. So I just wanted to say thanks again for everyone's help in this thread.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts