mark83 Posted August 23, 2007 Posted August 23, 2007 Hmm I'm struggling with the cleanup file.I doesn't cleanup og even restartIt's run from runonceex.cmdRunOnceEx.cmdcmdow @ /HID@echo offFOR %%i IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\CD.txt SET CDROM=%%i:SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Installerer programmer" /fREG ADD %KEY%01 /VE /D "Office 2003" /fREG ADD %KEY%01 /V 1 /D "%CDROM%\Software\OfficeXP\setup.exe TRANSFORMS=Unattended.MST /qb-TRANSFORMS=Unattended.MST /qb-" /fREG ADD %KEY%02 /VE /D "IrfanView 4.00" /fREG ADD %KEY%02 /V 1 /D "%CDROM%\Software\IrfanView\IrfanView400Setup.exe" /fREG ADD %KEY%03 /VE /D "Deep Burner 1.8.0.224" /fREG ADD %KEY%03 /V 1 /D "%CDROM%\Software\DeepBurner\DeepBurner180224.exe" /fREG ADD %KEY%04 /VE /D "WGAFIX" /fREG ADD %KEY%04 /V 1 /D "%CDROM%\Software\WgaFix\WGAFIX.exe" /fREG ADD %KEY%06 /VE /D "Rydder op og genstarter" /f REG ADD %KEY%06 /V 1 /D "%CDROM%\Software\cleanup.cmd" /fEXIT(Rydder op og genstarter = Danish for Cleaning up and restarting) :-)cleanup.cmdcmdow @ HIDshutdown.exe -r -f -t 60 -c Windows XP genstarter om 1 minut...net user aspnet deleteDEL %systemroot%.bmpDEL %systemroot%WebWallpaper.jpgDEL %systemroot%system32dllcache.scrDEL %systemroot%system32.scrDEL /S /Q %AllUsersProfile%Start MenuWindows Update.lnkDEL /S /Q %AllUsersProfile%Start MenuSet Program Access and Defaults.lnkDEL /S /Q %AllUsersProfile%Start MenuWindows Catalog.lnkRD S Q %systemdrive%driversRD S Q %systemdrive%installEXITwhat could be wrong ?
jaws75 Posted August 23, 2007 Posted August 23, 2007 (edited) The first line of your cleanup.cmd should becmdow @ /HIDnotcmdow @ HIDedit: I just noticed a bunch of other errors in it as wellRD S Q should be RD /S /QDEL should be DEL /Qalso missed quotes and \here. easier to just fix them all for ya.cmdow @ /HIDshutdown.exe -r -f -t 60 -c Windows XP genstarter om 1 minut...net user aspnet deleteDEL /Q %systemroot%\*.bmpDEL /Q %systemroot%\WebWallpaper.jpgDEL /Q %systemroot%\system32dllcache.scrDEL /Q %systemroot%\system32.scrDEL /Q "%AllUsersProfile%\Start Menu\Windows Update.lnk"DEL /Q "%AllUsersProfile%\Start Menu\Set Program Access and Defaults.lnk"DEL /Q "%AllUsersProfile%\Start Menu\Windows Catalog.lnk"RD /S /Q %systemdrive%\driversRD /S /Q %systemdrive%\installEXIT Edited August 23, 2007 by jaws75
jaws75 Posted August 23, 2007 Posted August 23, 2007 (edited) OK I edited it a few times so check it again...also I don't know if this path is correct.%systemroot%\system32dllcache.scrI use Vista not XP so I don't know what it's referring tohope it helps Edited August 23, 2007 by jaws75
mark83 Posted August 23, 2007 Author Posted August 23, 2007 hmm...maybe is shuld change start menu to menuen start as it's called (danish version), and if i shuld delete shortcuts on the desktop it's called skrivebord, so maybe this one will work ?I have applied the quick menu, but how do i delete a shortcut which is only in the administrator folderIt is locatet here: Administrator\Application Data\Microsoft\Internet Explorer\Quick Launchand is call" DeepBurner.lnkcmdow @ /HIDshutdown.exe -r -f -t 60 -c Windows XP genstarter om 1 minut...net user aspnet deleteDEL /Q %systemroot%\*.bmpDEL /Q %systemroot%\WebWallpaper.jpgDEL /Q %systemroot%\system32dllcache.scrDEL /Q %systemroot%\system32.scrDEL /Q "%AllUsersProfile%\Menuen Start\Windows Update.lnk"DEL /Q "%AllUsersProfile%\Menuen Start\Set Program Access and Defaults.lnk"DEL /Q "%AllUsersProfile%\Menuen Start\Windows Catalog.lnk"DEL /Q "%AllUsersProfile%\Skrivebord\DeepBurner.lnk"DEL /Q "%AllUsersProfile%\Skrivebord\IrfanView.lnk"DEL /Q "%AllUsersProfile%\Skrivebord\IrfanView Thumbnails.lnk"RD /S /Q %systemdrive%\driversRD /S /Q %systemdrive%\installEXIT
mark83 Posted August 23, 2007 Author Posted August 23, 2007 Look at the attatchmentThese are the two folders im trying to delete files in.underneath my cleanup file is shownThe part where the clean up files shuld delete three files from the "menuen start", works fine... but not the rest, how come ?
Yzöwl Posted August 23, 2007 Posted August 23, 2007 From your graphic, DeepBurner.lnk, IrfanView.lnk and IrfanView Thumbnails.lnk are all located under the Administrators Profile and you are trying to delete them from the All Users Profile!
mark83 Posted August 23, 2007 Author Posted August 23, 2007 From your graphic, DeepBurner.lnk, IrfanView.lnk and IrfanView Thumbnails.lnk are all located under the Administrators Profile and you are trying to delete them from the All Users Profile!Okay...whats the correct DEL command then?
gunsmokingman Posted August 23, 2007 Posted August 23, 2007 From your graphic, DeepBurner.lnk, IrfanView.lnk and IrfanView Thumbnails.lnk are all located under the Administrators Profile and you are trying to delete them from the All Users Profile!Okay...whats the correct DEL command then?Are you using the account that was listed in the image you posted?If so then use a different varible for that folder.Try this in your codeSet QL=%AppData%\Microsoft\Internet Explorer\Quick Launch\Del /Q "%QL%DeepBurner.lnk"
Yzöwl Posted August 23, 2007 Posted August 23, 2007 Okay...whats the correct DEL command then?Instead of using %AllUsersProfile% in those non-working deletions, change them to %UserProfile%CMDOW @ /HIDSHUTDOWN -r -f -t 60 -c Windows XP genstarter om 1 minut...NET USER aspnet deleteDEL /Q "%SystemRoot%\*.bmp"DEL /Q "%SystemRoot%\Web\Wallpaper\*.jpg"DEL /Q "%SystemRoot%\system32\dllcache\*.scr"DEL /Q "%SystemRoot%\system32\*.scr"DEL "%AllUsersProfile%\Menuen Start\Windows Update.lnk"DEL "%AllUsersProfile%\Menuen Start\Set Program Access and Defaults.lnk"DEL "%AllUsersProfile%\Menuen Start\Windows Catalog.lnk"DEL "%UserProfile%\Skrivebord\DeepBurner.lnk"DEL "%UserProfile%\Skrivebord\IrfanView.lnk"DEL "%UserProfile%\Skrivebord\IrfanView Thumbnails.lnk"DEL "%AppData%\Microsoft\Internet Explorer\Quick Launch\DeepBurner.lnk"RD /S /Q %systemdrive%\driversRD /S /Q %systemdrive%\install
jaws75 Posted August 23, 2007 Posted August 23, 2007 OK I don't understand these...DEL "%SystemRoot%\WebWallpaper.jpg"DEL "%SystemRoot%\system32dllcache.scr"DEL "%SystemRoot%\system32.scr"do you mean this...DEL /q "%SystemRoot%\Web\Wallpaper\*.jpg"DEL /q "%SystemRoot%\system32\dllcache\*.scr"DEL /q "%SystemRoot%\system32\*.scr"this will delete all .jpg and .scr files in those directories.And Yzöwl doesn't the del command need the /q switch to be silent or won't it ask you to confirm on each del command?
Yzöwl Posted August 24, 2007 Posted August 24, 2007 OK I don't understand these...DEL "%SystemRoot%\WebWallpaper.jpg"DEL "%SystemRoot%\system32dllcache.scr"DEL "%SystemRoot%\system32.scr"do you mean this...DEL /q "%SystemRoot%\Web\Wallpaper\*.jpg"DEL /q "%SystemRoot%\system32\dllcache\*.scr"DEL /q "%SystemRoot%\system32\*.scr"this will delete all .jpg and .scr files in those directories.I suspect you are correct,since it appears that the backslashes were missing in the opening post!And Yzöwl doesn't the del command need the /q switch to be silent or won't it ask you to confirm on each del command?No the /q switch is not needed in those cases, it is only required on those lines using 'global wildcards', i.e. those using asterisks.I have altered my example to make the same assumptions as yourself on those files too!
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