Deleting Locked Files & Folders
Asked Answered
S

2

9

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?

Shikari answered 24/5, 2010 at 14:2 Comment(3)
Incidentally, replacing drivers is one of the major reasons Windows still requires reboots. Now, some drivers don't seem to need them anymore (nVidia drivers don't prompt for a reboot, they just disable the display momentarily).Hominy
@R. Bemrose: If I understand correctly, this works by separating the driver up into a core that stays loaded and the actual meat of the driver, which can be unloaded and replaced. In other words, OP may not have any options.Maisel
Well they're printer drivers and printers aren't always in use. I learnt how to spooler service.Shikari
K
5

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

Kimberli answered 24/5, 2010 at 15:0 Comment(0)
C
0

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

Ciliolate answered 24/5, 2010 at 14:25 Comment(1)
#1438871Kimberli

© 2022 - 2024 — McMap. All rights reserved.