Nihilator Posted March 16, 2006 Posted March 16, 2006 (edited) I have created a simple (.inf) file named cleanup.inf.Here it is:[Version]Signature=$CHICAGO$[DefaultInstall]DelFiles=cleanup[cleanup]MSN Explorer.lnk;end of fileAnyway, my goal is to delete the MSN Explorer icon in the following directory:C:\Documents and Settings\All Users\Desktop\MSN Explorer.lnkHow do I tell the inf the file is in a specific directory. I'm confused on writing my first inf. I'm used to batch files. All the examples I see on the internet just name the file that you want to delete WITHOUT any path to the filename. My concern is that I have multiple MSN Explorer.lnk files. I only want to delete the one in the path that i've given above. Could someone help me out with this example? I thank you in advance if you could help because i'm not understanding.Thanks, Niatross Edited March 16, 2006 by Nihilator
Delprat Posted March 16, 2006 Posted March 16, 2006 The path to the files to delete for a DelFiles section must be specified via the DestinationDirs section.Add this to your inf :[DestinationDirs]cleanup=1640916409 is the "magic number" to specify the "%AllUsersProfile%\Desktop" folder.(taken from here)Also, you should change the signature to "$Windows NT$", 'coz your INF may not run on 9x.See also this site and clik "Infs" in the top menu
Nihilator Posted March 16, 2006 Author Posted March 16, 2006 Thanks Delprat. I see how it works. Thanks very much I have one more question. If I want to delete the cleanup.inf after it runs my clean up commands, how would I do it?It seems like I would have to do it on next reboot since this inf is in memory running.Thanks, Niatross
Djé Posted March 16, 2006 Posted March 16, 2006 It seems like I would have to do it on next reboot since this inf is in memory running.I don't think so.Try to add another 'DelFiles' section for your inf:[DefaultInstall]DelFiles=cleanup,cleandown[cleandown]myself.inf[DestinationDirs]cleanup=16409cleandown=YourInfFolderMay I ask why do you want to use .inf instead of batch for this?
Nihilator Posted March 16, 2006 Author Posted March 16, 2006 (edited) I'm choosing inf over batch because it's cleaner. A batch shows a cmd window when it runs, then diappears quicky, which is ugly. I'm going to be running this inf from my [GUIRUNONCE]. Edited March 16, 2006 by Nihilator
Delprat Posted March 17, 2006 Posted March 17, 2006 I'm choosing inf over batch because it's cleaner. A batch shows a cmd window when it runs, then diappears quicky, which is ugly. I'm going to be running this inf from my [GUIRUNONCE].An INF shows a "copying files" window if there is at least one CopyFiles= section or one AddReg= section in the Install section being processed (and that window "stucks" during all the install process, but the progressbar shows only the copying process).I don't use [GUIRUNONCE], but if it allows command line parameters you can use StartX.exe to hide the cmd window before it's creation :X:\Path_to\StartX.exe /WAIT /B Z:\Path_to\YourBatch.cmd(search on the forum for a DL link to StartX)That's less "ugly" that using CMDOW @ /HID (I guess that's you're using, am I right ?)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now