#1
|
|||
|
|||
How to?-How to mark a file at the OS level
Here's the scenario I want to be able to programmatically mark a file in a way with a flag or something that will tell the OS to do something with the file.
For example...I know uninstallers when uninstalling an app deletes some of the files related to an application but sometimes to compleletly remove the software the computer needs to be rebooted as some file are being used by the system. However, once the reboot occurs the un-installer has marked the file to be deleted at reboot i.e. before the operating system loads it again. I know the un-installer marks the file because a few days ago i un-installed an application and without rebooting i tried to reinstall it and the OS (Win XP) gave me an alert that said something like "Cannot install because [some_filename_here] is marked for deletion" How does the un-installer do this? And how can i accomplish this using some programming language preferable VB/C#.Net or VB? Thank you in advance for any help |
#2
|
|||
|
|||
I don't know, but have you checked if the file in use can be renamed? If it's renamed such that it's not loaded on reboot, an application can then remove it when the OS is loaded.
|
#3
|
|||
|
|||
The installer just has a specific file/reg location, where it stores files to delete at the next reboot. Then, the uninstaller deletes the files, or, if started before reboot complains about the fact, that there are files in the setup, which will be affected by the next startup-delete-process.
there is no real "mark" (on a filesystem-level, or whatever you thought about), its just an information the installer itself uses and stores somewhere. |
#4
|
|||
|
|||
Hi,
Take a look: http://www.diamondcs.com.au/index.php?page=dellater Probably, this is rellated with your question. Regards, Opc0de |
#5
|
|||
|
|||
SOLAR, i think this file is marked in installer/uninstaller rather than OS. There wouldnt be any point preventing access to file if its going to be deleted anyway, so i think thats just something author of installer made up to fix some issue he had. You can simply write a program to delete files you want, add it to autorun in registry, so when computer restarts it deletes the file and removes itself from registry. Or maybe even adding it to services if file you want to delete is loaded as service, and therefor cant be deleted becouse its already started...
|
#6
|
|||
|
|||
Thanks for all responses u guys are right i just realize a few hours after posting that it isnt os level and in fact very simple to do.
|
#7
|
|||
|
|||
well hklm\ and or hkcu
\softawre\microsoft\windows\ has runonce and runonce ex keys they are accessed on boot and run so you have set a key like cmd \c del blah.exe it wil run cmd and delte the file during boot also in this key there is a value PendingFileRenameoperation it takes HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager this key takes multiple file names as arguments and deletes them all during next reboot |
#8
|
|||
|
|||
Look at this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/movefileex.asp Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mark memory page as invalid | Kerlingen | General Discussion | 3 | 08-29-2016 19:49 |
Cracking Apps Gromit! by Mark Danks | elephant | General Discussion | 1 | 07-02-2015 02:10 |
Is the 'HAL dll' the lowest level file? | Rhodium | General Discussion | 5 | 08-12-2004 21:47 |
How to modify the mark of a compressor? | eriC | General Discussion | 1 | 11-08-2002 05:21 |