views:

223

answers:

2

Hello

I am writing an application that updates some drivers. However the drivers are "in use" and can't be deleted unless I restart my computer.

So how can I write an application to delete these locked drivers without restarting the PC. IF Restarting MUST occur then how can I relaunch my application automatically when the computer restarts and delete those files?

A: 

If you can disable the hardware that's using the drivers, this might allow the driver to be unloaded and replaced.

Dan Puzey
How do you disable it with code?
Cocoa Dev
http://stackoverflow.com/questions/1438371/win32-api-function-to-programatically-enable-disable-device
Alex K.
+3  A: 

For Windows, you can "schedule" moving/deleting files around on a reboot by pinvoking the MoveFileEx API (Or the registry as described).

Alex K.