Disoriented One Posted April 5, 2004 Posted April 5, 2004 Here is a copy of my cleanup.cmdcmdow @ /HIDshutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute..."net user aspnet /deleteRD /S /Q "%AllUsersProfile%\Start Menu\Programs\Java Web Start"DEL "%UserProfile%\Start Menu\Programs\Windows Media Player.lnk"DEL "%AllUsersProfile%\Start Menu\Programs\Windows Movie Maker.lnk"DEL "%AllUsersProfile%\Desktop\Java Web Start.lnk"DEL "%AllUsersProfile%\Start Menu\Programs\LaunchRA.lnk"DEL "%systemdrive%\Install\"RD /S /Q %systemdrive%\Install\RD /S /Q %systemdrive%\drivers\EXITEverything else seems to be working as advertised. But after all is said and done "C:\Install" is still there. Any ideals as to what I'm doing wrong?Thanks
maxXPsoft Posted April 6, 2004 Posted April 6, 2004 If you do have Admin rights which was one of my problem's but no longer. Move this line down to right above EXIT.shutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute..."EXITI also use this format since its correct syntax. rd [Drive:]Path [/q]Work's for me.RD %systemdrive%\drivers\ /S /Q
DarkBringer Posted April 6, 2004 Posted April 6, 2004 One of these ought to work. Remember to put the Drivers directory above the Install directory or the Drivers directory won't get deleted.RD /S /Q "%systemdrive%\Drivers"RD /S /Q "%systemdrive%\Install"RMDIR /S /Q %systemdrive%\Drivers\RMDIR /S /Q %systemdrive%\Install\
KMan Posted April 6, 2004 Posted April 6, 2004 Hi!this also can be a timing issue, i had this when testing on a VMWare Enviourement, increasing the reboot time form 60 to 90 seconds solved this issue for me once and for all, so might also be worth a try!GreetzKMan
gosh Posted April 6, 2004 Posted April 6, 2004 I've always used this code and it's always worked for me. I have the code run last, and anything that takes a long time to install such as nero i put at the top of the list.HKLM,"%RunOnceEx%\ZZcleanup",2,,"%11%\cmd.exe /c rd /S /Q %10%\Apps"-gosh
Disoriented One Posted April 6, 2004 Author Posted April 6, 2004 Thanks for all the replies. I'll report back later.
Disoriented One Posted April 7, 2004 Author Posted April 7, 2004 maxXPsoft,If you do have Admin rights which was one of my problem's but no longer. Move this line down to right above EXIT.shutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute..."EXITWhen I tried this, it just hung there. Never rebootedKMan, I increased time to 2 mins and no helpHKLM,"%RunOnceEx%\ZZcleanup",2,,"%11%\cmd.exe /c rd /S /Q %10%\Apps"Sorry Gosh, I'm completely lost on how to apply this code. And what is ZZcleanup?Please pardon my ignorance,Thanks
maxXPsoft Posted April 7, 2004 Posted April 7, 2004 When I tried this, it just hung there. Never rebootedThat narrows it down. Ok then if it hangs something else is wrong above that.Heres minecmdow @ /HIDnet user aspnet /deleteRD "%systemdrive%\Documents and Settings\All Users\Start Menu\Programs\PrintMe Internet Printing" /S /QRD "%systemdrive%\Documents and Settings\All Users\Start Menu\Programs\Java Web Start" /S /QDEL "%AllUsersProfile%\Desktop\Adobe Reader 6.0.lnk"DEL "%AllUsersProfile%\Desktop\Java Web Start.lnk"REM Cleanup Winzip if you have it. Remove if you don'tDEL "%AllUsersProfile%\start menu\WinZip.lnk"DEL "%AllUsersProfile%\desktop\WinZip.lnk"DEL "%AllUsersProfile%\start menu\Programs\WinZip\Uninstall WinZip.lnk"DEL "%AllUsersProfile%\start menu\Programs\WinZip\Help Manual.lnk"DEL "%AllUsersProfile%\start menu\Programs\WinZip\ReadMe.txt.lnk"DEL "%AllUsersProfile%\start menu\Programs\WinZip\What's New.lnk"REM Unhide protected Operating System FilesREG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /V ShowSuperHidden /t REG_DWORD /D "1" /fRD %systemdrive%\drivers\ /S /QRD %systemdrive%\install\ /S /Qshutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute..."EXITAnd it work's, like I said I had problem's with it hanging cause my user wasn't getting Admin and I corrected that.
maxXPsoft Posted April 7, 2004 Posted April 7, 2004 Just noticed also that yours has thisDEL "%systemdrive%\Install\"RD /S /Q %systemdrive%\Install\Remove the DEL "%systemdrive%\Install\" cause you getting that with next line with the RD which removes entire dir and thats probably where its hanging.
Disoriented One Posted April 7, 2004 Author Posted April 7, 2004 maxXPsoft,Thanks to you I have made some progress. This is what I have so far.cmdow @ /HIDnet user aspnet /deleteRD /S /Q "%AllUsersProfile%\Start Menu\Programs\Java Web Start"DEL "%UserProfile%\Start Menu\Programs\Windows Media Player.lnk"DEL "%AllUsersProfile%\Start Menu\Programs\Windows Movie Maker.lnk"DEL "%AllUsersProfile%\Desktop\Java Web Start.lnk"DEL "%AllUsersProfile%\Start Menu\Programs\LaunchRA.lnk"RD /S /Q %systemdrive%\Drivers\RD /S /Q %systemdrive%\Install\shutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1minute..."EXITThis would delete everything in C:\Install but not the directory itself and shut.exe would not run.I then put shutdown.exe in the third line and it executes just fine and deletes everything in C:\Install. I know there is more than one way to skin a cat.Thanks for your help
Aaron Posted April 7, 2004 Posted April 7, 2004 Because you have RD /S /Q %systemdrive%\Install\ before the shutdown command, it deletes the install directory, thus killing the batch file thats in there. Its more wise to have the RD command last, and place shutdown somewhere above it.
maxXPsoft Posted April 7, 2004 Posted April 7, 2004 Disoriented OneThen it was thatDEL "%systemdrive%\Install\"RD /S /Q %systemdrive%\Install\AaronWhat I posted works for me cause I'm thinking when you run the batch it's loaded into memory or in process. My Install get's deleted but is it because of processor, memory or what? Maybe fast processor is running next line . I don't know.With the shutdown.exe -r -f -t 60 you have 60 seconds to carry out everything so that's plenty of time so moving it above certainly wouldn't hurt.Good ? or no.I may move mine above but i'm gonna test this a little, maybe write a bogus script that takes time then delete it and see what give's.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now