Incroyable HULK Posted December 25, 2004 Share Posted December 25, 2004 During my cleanup phase of my setup I have this last command:RD /S /Q "%systemdrive%\install\"Everything inside this folder get deleted properly EXCEPT for one file named Lancement.exe. I beleive it is not deleted because Windows think it is still in use.Is there a way to Force Delete this directory?EDIT: or maybe a way to force delete the file %systemdrive%\install\Lancement.exe Link to comment Share on other sites More sharing options...
Fezik Posted December 25, 2004 Share Posted December 25, 2004 Pff, just delete it when you're done installing Link to comment Share on other sites More sharing options...
turbomcp Posted December 25, 2004 Share Posted December 25, 2004 maybe run taskil on itbefore running delete Link to comment Share on other sites More sharing options...
sixpack Posted December 25, 2004 Share Posted December 25, 2004 or delete it on next boot via registery[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]"Cleanup1"="cmd /C RD %systemdrive%\\install /S /Q" Link to comment Share on other sites More sharing options...
Incroyable HULK Posted December 25, 2004 Author Share Posted December 25, 2004 Odd... my install folder is still there even if it is empty now (I used kill.exe for Win2000 to terminate the Lancement.exe process)If I restart my cleanup.cmd again (2nd time) now it will be deletedHere is my cleanup.cmd:RD /S /Q "%AllUsersProfile%\Menu D‚marrer\Programmes\DivX"DEL "%UserProfile%\Application Data\Microsoft\Internet Explorer\Quick Launch\Ad-Aware SE Personal.lnk"DEL "%UserProfile%\Bureau\Connexion … Internet.lnk"DEL "%AllUsersProfile%\Menu D‚marrer\Programmes\D,marrage\Lancement rapide d'Adobe Reader.lnk"DEL "%AllUsersProfile%\Bureau\Adobe Reader 7.0.lnk"DEL "%AllUsersProfile%\Bureau\DivX Movies.lnk"DEL "%AllUsersProfile%\Bureau\DivX Player.lnk"DEL "%windir%\PnPdrvrs.exe"RD /S /Q "%windir%\PnPdrvrs\"RD /S /Q "%systemdrive%\í\"RD /S /Q "%systemdrive%\Intel\"RD /S /Q "%systemdrive%\install" Link to comment Share on other sites More sharing options...
sixpack Posted December 25, 2004 Share Posted December 25, 2004 RD /S /Q "%systemdrive%\install"RD /S /Q "%systemdrive%\install\" Link to comment Share on other sites More sharing options...
gunsmokingman Posted December 25, 2004 Share Posted December 25, 2004 Here Try This It My Clean Up Template It Will Remove every thing. Edit it To Suit Your Needs.R1_CleanUp.cmd Link to comment Share on other sites More sharing options...
Incroyable HULK Posted December 27, 2004 Author Share Posted December 27, 2004 Thank you guys.Just to keep you informed, here is the latest developpement.I've been using kill.exe (same as taskkill but for Win2000) to remove Lancement.exe from the active process. This was a BAD idea. Since it was launched from GuiRunOnce in my winnt.sif, as soon as I killed this process, the desktop would load while my RunOnceEx was running... I also had another mixed issue with Adobe Reader 7 (read HERE)Then I tought it was because I converted my .cmd to .exe I wasn't able to delete my Install folder. It turns out that even with batch files the same will happen.From my understanding, if you are launching a batch file from %systemdrive%\Install\ the stuff is executed by Windows at that location. This is why I can't delete my Install folder properly. My Workaround for this is that I have changed the location of my Install folder. From now on, it is located inside %windir%\Temp\ so I don't mind if it stay there...Here is my event timeline:1) GuiRunOnce is launching Lancement.exe in my %windir%\Temp\ folder2) Lancement.exe (.cmd converted) is scanning for the %CDROM% and then launching Installation.exe3) Installation.exe (my RunOnceEx.cmd converted) is starting my applications installation4) Installation.exe is launching Nettoyage.exe (cleanup.cmd converted) also located on my %CDROM%Keep in mind that Windows is executing all theses .exe in my %windir%\Temp\Install so this is why I am not able to delete properly... Link to comment Share on other sites More sharing options...
a06lp Posted December 27, 2004 Share Posted December 27, 2004 i just run my cleanup following a reboot.(after all programs install, i add cleanup to runonceex, and use psshutdown to reboot. then, the next loadup deletes all the folders/files/shortcuts. no problems this way) Link to comment Share on other sites More sharing options...
gunsmokingman Posted December 27, 2004 Share Posted December 27, 2004 (edited) Here A Vbs Code That deletes It Self RED Means You Can ChangeORANGE Means You Can KEEP OR REMOVE LINEDim Garbageset Garbage = (CreateObject("Scripting.FileSystemObject"))msgbox "Starting Clean UP?",vbokonly+48,"Clean Up"Garbage.DeleteFile ("\CU1.vbs")wscript.sleep 500Delete=("\CU1.vbs")wscript.sleep 500msgbox "Clean UP Completed?",vbokonly+48,"Clean Up Those Files"Here A Cmd That Produces The Same Vbs But It Wont Delete The Cmd. Use This To Make As Many Needed.echo off clscolor f2mode con: cols=55 Lines=3Title Test Remove Vbs > %Systemdrive%\CU1.vbs echo Dim Garbage>> %Systemdrive%\CU1.vbs echo set Garbage = (CreateObject("Scripting.FileSystemObject"))>> %Systemdrive%\CU1.vbs echo msgbox "Starting Clean UP?",vbokonly+48,"Clean Up">> %Systemdrive%\CU1.vbs echo Garbage.DeleteFile ("\CU1.vbs")>> %Systemdrive%\CU1.vbs echo wscript.sleep 500>> %Systemdrive%\CU1.vbs echo Delete= ("\CU1.vbs")>> %Systemdrive%\CU1.vbs echo wscript.sleep 500>> %Systemdrive%\CU1.vbs echo msgbox "Clean UP Completed?",vbokonly+48,"Clean Up Those Files"start /w %Systemdrive%\CU1.vbsset /p = Press Key To CloseThe Above Are From My Clean Up Template I Just Change some Of the Names And Took Out The Test And Short Cut Sections. Edited March 3, 2006 by gunsmokingman Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now