Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 05-30-2005, 02:28
SOLAR SOLAR is offline
Friend
 
Join Date: Aug 2004
Posts: 126
Rept. Given: 6
Rept. Rcvd 2 Times in 2 Posts
Thanks Given: 12
Thanks Rcvd at 6 Times in 6 Posts
SOLAR Reputation: 2
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
Reply With Quote
  #2  
Old 05-30-2005, 02:34
Sarre
 
Posts: n/a
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.
Reply With Quote
  #3  
Old 05-30-2005, 03:02
aldente aldente is offline
VIP
 
Join Date: Jul 2003
Posts: 266
Rept. Given: 27
Rept. Rcvd 7 Times in 5 Posts
Thanks Given: 35
Thanks Rcvd at 10 Times in 9 Posts
aldente Reputation: 7
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.
Reply With Quote
  #4  
Old 05-30-2005, 04:49
Opc0de
 
Posts: n/a
Hi,

Take a look:
http://www.diamondcs.com.au/index.php?page=dellater

Probably, this is rellated with your question.

Regards,
Opc0de
Reply With Quote
  #5  
Old 05-30-2005, 05:24
nikola nikola is offline
Friend
 
Join Date: Jan 2004
Location: Your head
Posts: 115
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 1 Time in 1 Post
nikola Reputation: 0
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...
Reply With Quote
  #6  
Old 05-30-2005, 10:05
SOLAR SOLAR is offline
Friend
 
Join Date: Aug 2004
Posts: 126
Rept. Given: 6
Rept. Rcvd 2 Times in 2 Posts
Thanks Given: 12
Thanks Rcvd at 6 Times in 6 Posts
SOLAR Reputation: 2
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.
Reply With Quote
  #7  
Old 05-30-2005, 18:45
JuneMouse
 
Posts: n/a
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
Reply With Quote
  #8  
Old 05-30-2005, 21:28
Cobi Cobi is offline
Friend
 
Join Date: Sep 2004
Location: Germany
Posts: 55
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 1 Time in 1 Post
Cobi Reputation: 0
Look at this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/movefileex.asp

Quote:
If dwFlags specifies MOVEFILE_DELAY_UNTIL_REBOOT and lpNewFileName is NULL, MoveFileEx registers the lpExistingFileName file to be deleted when the system restarts. If lpExistingFileName refers to a directory, the system removes the directory at restart only if the directory is empty.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


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


All times are GMT +8. The time now is 07:39.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )