Page 1 of 1

Delete Directory Even If Program Is Running?

Posted: 20 Jan 2010 13:38
by limitdos
I have alot of students that install toolbars...including the google toolbar.
I use rd to delete the directory of the toolbar, is there a way to delete a directory, even if a program is running inside it?

I try to delete the GoogleToolbarNotifier directory, but it has a program that runs when the computers startup, so rd will not delete it.

i'm using:
rd /s "C:\Program Files\Google\GoogleToolbarNotifier" /q


My fundamental problem is I have computers that are slowed down because there are so many toolbars installed on some of the computers.

Posted: 20 Jan 2010 14:55
by alan_b
Windows will not allow you to delete a folder while a process is running within it. First you have to kill the process.

Windows Task Manager / Applications will allow you to select and "End Task".
You may then need "Processes" Tab in case the exe is still alive, in which case "End Process" - or in extreme conditions right click the process and choose "End Process Tree".

Alan

Posted: 20 Jan 2010 21:26
by limitdos
alan_b wrote:Windows will not allow you to delete a folder while a process is running within it. First you have to kill the process.

Windows Task Manager / Applications will allow you to select and "End Task".
You may then need "Processes" Tab in case the exe is still alive, in which case "End Process" - or in extreme conditions right click the process and choose "End Process Tree".

Alan


How do I get a batch file to do that?

I don't want to walk around to each computer log them off and log back on just to end a google toolbar notifier program and then delete it and then log them back on....

the students don't have access to the task list....only i do...thats the way the IT guy set it up at my school.

Posted: 21 Jan 2010 02:09
by alan_b
See http://commandwindows.com/taskkill.htm

Availability depends on whether you use XP Home or XP Professional.
If you use a different system you can Google for equivalents, or wait for some-one else to advise.

Just be careful what you kill ! ! !

Alan

Posted: 21 Jan 2010 08:34
by limitdos
alan_b wrote:See http://commandwindows.com/taskkill.htm

Availability depends on whether you use XP Home or XP Professional.
If you use a different system you can Google for equivalents, or wait for some-one else to advise.

Just be careful what you kill ! ! !

Alan


thank you guys for the info....

I have XP Professional on all my computers...looks like I'll try task kill

edit:
I noticed it hangs for a good while to task kill the program....

is there anyway to say IF googletoolbarnotifier.exe is running end it?

that way it will only try to end it if its running.