Mojo Posted September 3, 2005 Share Posted September 3, 2005 del "$$\System32\sleep.exe" del "$$\System32\cmdow.exe"If i'm not mistaking, this code won't work. The $$ folder, once copied during setup, becomes %SystemRoot%.So in order to delete these 2 files, imo you should usedel "%SystemRoot%\System32\sleep.exe" del "%SystemRoot%\System32\cmdow.exe"If it works your way, no problem. Else, i think you should use my suggestion. Link to comment Share on other sites More sharing options...
Marthax Posted September 3, 2005 Author Share Posted September 3, 2005 With $$, I ment the Windows folder as it says on the Unattended site, but I just checked it out and you guys are right, explorer doesn't understand it (syntax error). I'll just use %systemdrive%\Windows\system32.Anyway, Any more ideas on how I could solve this problem of mine? Link to comment Share on other sites More sharing options...
SoreGums Posted September 3, 2005 Share Posted September 3, 2005 Sounds to me like this is happening.Auto1. windows cd setup2. reboot3. runonceex4. not deleteing the folders/files5. reboot6. ready to goManual1. windows cd setup2. reboot3. runonceex4. not deleteing the folders/files5. reboot6. ready to go7. run cleanup.cmd8. files/folders deletedI reckon add reboot in your cleanup.cmd and add another runonceex to run deletethebloodyfiles.cmd.So1. windows cd setup2. reboot3. runonceex4. not deleteing the folders/files5. reboot6. run deletethebloodyfiles.cmd8. files/folders deleted9. reboot10. ready to goWhatcha think? Link to comment Share on other sites More sharing options...
gunsmokingman Posted September 3, 2005 Share Posted September 3, 2005 Try the VBS script I left above in your runonceExampleREG ADD %KEY% /V TITLE /D "The Install Section" /fREG ADD %KEY%\000 /VE /D "Preparing Installation..." /fREG ADD %KEY%\001 /VE /D "Wrar320ce" /fREG ADD %KEY%\001 /V 1 /D "%CDROM%Apps\Winrar\WinRar.exe" /fREG ADD %KEY%\003 /VE /D "SCD10en" /fREG ADD %KEY%\003 /V 1 /D "%CDROM%Apps\SCD10en.exe /q" /fREG ADD %KEY%\005 /VE /D "Preparing Clean Up" /fREG ADD %KEY%\005 /V 1 /D "%CDROM%Apps\Cleanup.Vbs" /fSave As CleanUp.vbsDim Act, AllDesk, All_UP, DelFile, DelFolder, Fso, SD, Udesk, User_PSet Act = CreateObject("Wscript.shell")Set Fso = CreateObject("Scripting.FileSystemObject")All_UP = Act.ExpandEnvironmentStrings("%Allusersprofile%")User_P = Act.ExpandEnvironmentStrings("%UserProfile%")SD = Act.ExpandEnvironmentStrings("%Systemdrive%")AllDesk = All_UP & "\Start Menu\Programs"Udesk = User_P & "\Start Menu\Programs"'''' SHUT DOWN Act.Run("shutdown.exe -t 25 -r -f -c ""Preparing To reboot"""), 1,True'''' ARRAY FOR FILES TO DELETEDelFile = Array(All_UP & "\Start Menu\Programs\Adobe Reader 6.0.3.lnk",All_UP & "\Desktop\*.*",_User_P & "\Desktop\*.*",User_P & "\Start Menu\Programs\Remote Assistance.lnk",All_UP & "\Desktop\VLC media player.lnk",_User_P & "\Desktop\Spybot - Search & Destroy.lnk",User_P & "\Desktop\Skype.lnk",User_P & "\Desktop\Notepad++.lnk",_All_UP & "\Start Menu\Programs\Startup\Adobe Gamma Loader.lnk",User_P & "\Start Menu\Programs\Outlook Express.lnk",_All_UP & "\Start Menu\Set Program Access and Defaults.lnk",All_UP & "\Start Menu\Windows Catalog.lnk",SD & "\autoexec.bat",_SD & "\config.sys")''''DELETES ALL THE FILES IN DELFILEFor Each StrFile In DelFile If Fso.FileExists(StrFile) Then Fso.DeleteFile(Chr(34) & StrFile & Chr(34)) Else On Error Resume NextEnd IfNext''''ARRAY TO DELETE FOLDERSDelFolder = Array(AllDesk & "\Administrative Tools",AllDesk & "\Nvidia Corporation",AllDesk & "\7-Zip",_AllDesk & "\Gaim",AllDesk & "\Mozilla Firefox",User_P & "\My Documents\My Music",User_P & "\My Documents\My Pictures",_AllDesk & "\Accessories", All_UP & "\Start Menu\Accessories",User_P & "\Start Menu\Programs\Accessories",_AllDesk & "\Nero",User_P & "\My Documents\My Skype Pictures",AllDesk & "\EA Games", AllDesk & "\Spybot - Search & Destroy",_AllDesk & "\Skype",AllDesk & "\WinRAR",AllDesk & "\VideoLAN",Udesk & "\Powertoys for Windows XP",Udesk & "\XP Codec Pack 1.0.3",_Udesk & "\Notepad++",Udesk & "\FirstClass",Udesk & "\Azureus",Udesk & "\foobar2000",Udesk & "\arniWORX",Udesk & "\TrackerV3",_SD & "\Drivers",SD & "\temp",SD & "\D",User_P & "\My Documents\My Pictures\Sample Pictures",SD & "\Install")''''DELETES THE FOLDERSFor Each StrFolder In DelFolderIf Fso.FolderExists(StrFolder) Then Fso.DeleteFolder(Chr(34) & StrFolder & Chr(34)) Else On Error Resume NextEnd IfNext Link to comment Share on other sites More sharing options...
Marthax Posted September 3, 2005 Author Share Posted September 3, 2005 I was just about to try that out, SoreGums and as soon as I've tried that, I'll try your script, Gunsmokingman. Link to comment Share on other sites More sharing options...
RayOK Posted September 4, 2005 Share Posted September 4, 2005 I am also getting the same problem with the D folder and those pesky shortcuts (IE, OE and Address Book) in the start menu. I run them the exact same way you do and was also thinking of the .vbs route.I think it doesn't get deleted because the DriverPack cleanup file that's supposed to do it is in the D folder itself. I mean, how can you delete the folder when the script that's deleting it is in the folder?? So, I stuck "RD /S /Q %systemdrive%\D" in my own cleanup script that runs right after the DriverPack one and it deletes it fine. For the IE, OE and Address Book shortcuts in the start menu, I'm pretty sure those are created *after* the RunOnceEx scripts are ran. I think this because in my script I do "DIR /S /B C:\ > dir.txt" and they are not listed anywhere. To solve this I was thinking of putting a script in the Startup folder and then deleting it before reboot. Anyone else have suggestions?Anyway, tell me how the .vbs script works out Link to comment Share on other sites More sharing options...
gunsmokingman Posted September 4, 2005 Share Posted September 4, 2005 At The end of the runonce add this line, so when you restart it will run the clean up.Last Line Of The RunOnceREG ADD %KEY%\470 /VE /D "Preparing Final Check clean Up"/f REG ADD %KEY%\470 /V 1 /D "%systemdrive%\WINDOWS\cleanup.cmd"/fCleanUp.cmdThis just a example use your own location, use a VBS file or Cmd Echo Off && CLS && Color f2 && Mode 55,3 && Title Final Clean UPSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx REG ADD %KEY%\999/VE /D "Preparing For Final Clean Up"/f REG ADD %KEY%\999 /V 1 /D "Wscript.exe %systemdrive%\WINDOWS\cleanup.Vbs"/f Link to comment Share on other sites More sharing options...
Marthax Posted September 4, 2005 Author Share Posted September 4, 2005 I tried it out with the cleanup.cmd once more and it didn't work. So, I did a little investigation and checked regedit. Guess what? The entry is there, but somehow, Windows doesn't execute it. I don't understand why. I've tried putting different numbers to rearrange the priority, but it didn't help a thing. I'm beggining to think that perhaps, I nLited my Windows a "little" to much and now, my Windows seems to be having some registry execution problems. Funny though, because it executes RunOnceEx.I'm not sure about this, but what do you guys think? Also, what services/components are required for registry entries to work properly? Link to comment Share on other sites More sharing options...
Marthax Posted September 7, 2005 Author Share Posted September 7, 2005 (edited) Well, I finally solved it and as it turned out, it was a silly mistake of me. The thing is that I use BBlean, which replaces explorer at the time when it's run and stops RunOnceEx from running since explorer has to run for it to start. So, I simply rearranged the setup process so that my Blackbox installs in the end and now everything works. Oh, I also had to combine 2 cleanup.cmd's to make it work since one didn't make it. I use the first one after the first restart. Then, this cleanup executes a file that places new information into RunOnceEx, telling it to execute Cleanup2.cmd after another restart. When the restart is done, Cleanup2.cmd executes and everything is gone. I tried using only cleanup.cmd after one restart, but it didn't remove everything since the "D" and "Install" folders were left. So the setup order is like this:1.RunOnceEx2.Restart3.Cleanup.cmd4.Restart5.Cleanup2.cmd & Blackbox6.RestartWell, thanks for your help anyway guys and I hope that this solves the problem for those of you that have the same problem as I did . Edited September 7, 2005 by Marthax Link to comment Share on other sites More sharing options...
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