MSFN Forum: cleanup.cmd - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

cleanup.cmd cleanup won't CLEAN UP Rate Topic: -----

#1 User is offline   mark83 

  • Newbie
  • Group: Members
  • Posts: 11
  • Joined: 22-August 07

Posted 23 August 2007 - 02:30 AM

Hmm I'm struggling with the cleanup file.

I doesn't cleanup og even restart

It's run from runonceex.cmd

RunOnceEx.cmd
 
cmdow @ /HID
@echo off

FOR %%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\RunOnceEx

REG ADD %KEY% /V TITLE /D "Installerer programmer" /f

REG ADD %KEY%01 /VE /D "Office 2003" /f
REG ADD %KEY%01 /V 1 /D "%CDROM%\Software\OfficeXP\setup.exe TRANSFORMS=Unattended.MST /qb-TRANSFORMS=Unattended.MST /qb-" /f

REG ADD %KEY%02 /VE /D "IrfanView 4.00" /f
REG ADD %KEY%02 /V 1 /D "%CDROM%\Software\IrfanView\IrfanView400Setup.exe" /f

REG ADD %KEY%03 /VE /D "Deep Burner 1.8.0.224" /f
REG ADD %KEY%03 /V 1 /D "%CDROM%\Software\DeepBurner\DeepBurner180224.exe" /f

REG ADD %KEY%04 /VE /D "WGAFIX" /f
REG ADD %KEY%04 /V 1 /D "%CDROM%\Software\WgaFix\WGAFIX.exe" /f

REG ADD %KEY%06 /VE /D "Rydder op og genstarter" /f 
REG ADD %KEY%06 /V 1 /D "%CDROM%\Software\cleanup.cmd" /f

EXIT 


(Rydder op og genstarter = Danish for Cleaning up and restarting) :-)

cleanup.cmd
 
cmdow @ HID
shutdown.exe -r -f -t 60 -c Windows XP genstarter om 1 minut...
net user aspnet delete

DEL %systemroot%.bmp
DEL %systemroot%WebWallpaper.jpg
DEL %systemroot%system32dllcache.scr
DEL %systemroot%system32.scr

DEL /S /Q %AllUsersProfile%Start MenuWindows Update.lnk
DEL /S /Q %AllUsersProfile%Start MenuSet Program Access and Defaults.lnk
DEL /S /Q %AllUsersProfile%Start MenuWindows Catalog.lnk

RD S Q %systemdrive%drivers
RD S Q %systemdrive%install

EXIT 


what could be wrong ?


#2 User is offline   jaws75 

  • Member
  • PipPip
  • Group: Members
  • Posts: 124
  • Joined: 22-April 06

Posted 23 August 2007 - 02:43 AM

The first line of your cleanup.cmd should be

cmdow @ /HID

not

cmdow @ HID

edit: I just noticed a bunch of other errors in it as well

RD S Q should be RD /S /Q

DEL should be DEL /Q

also missed quotes and \

here. easier to just fix them all for ya.

cmdow @ /HID
shutdown.exe -r -f -t 60 -c Windows XP genstarter om 1 minut...
net user aspnet delete

DEL /Q %systemroot%\*.bmp
DEL /Q %systemroot%\WebWallpaper.jpg
DEL /Q %systemroot%\system32dllcache.scr
DEL /Q %systemroot%\system32.scr

DEL /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%\drivers
RD /S /Q %systemdrive%\install

EXIT

This post has been edited by jaws75: 23 August 2007 - 02:52 AM


#3 User is offline   mark83 

  • Newbie
  • Group: Members
  • Posts: 11
  • Joined: 22-August 07

Posted 23 August 2007 - 02:55 AM

making iso, and trying...be "right" back

#4 User is offline   jaws75 

  • Member
  • PipPip
  • Group: Members
  • Posts: 124
  • Joined: 22-April 06

Posted 23 August 2007 - 02:55 AM

OK I edited it a few times so check it again...

also I don't know if this path is correct.
%systemroot%\system32dllcache.scr

I use Vista not XP so I don't know what it's referring to

hope it helps

This post has been edited by jaws75: 23 August 2007 - 02:56 AM


#5 User is offline   mark83 

  • Newbie
  • Group: Members
  • Posts: 11
  • Joined: 22-August 07

Posted 23 August 2007 - 03:47 AM

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 folder

It is locatet here: Administrator\Application Data\Microsoft\Internet Explorer\Quick Launch
and is call" DeepBurner.lnk

 
cmdow @ /HID
shutdown.exe -r -f -t 60 -c Windows XP genstarter om 1 minut...
net user aspnet delete

DEL /Q %systemroot%\*.bmp
DEL /Q %systemroot%\WebWallpaper.jpg
DEL /Q %systemroot%\system32dllcache.scr
DEL /Q %systemroot%\system32.scr

DEL /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%\drivers
RD /S /Q %systemdrive%\install

EXIT 


#6 User is offline   mark83 

  • Newbie
  • Group: Members
  • Posts: 11
  • Joined: 22-August 07

Posted 23 August 2007 - 04:41 AM

Look at the attatchment

These are the two folders im trying to delete files in.

underneath my cleanup file is shown

The part where the clean up files shuld delete three files from the "menuen start", works fine... but not the rest, how come ?

Attached File(s)



#7 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,195
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 23 August 2007 - 05:54 AM

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!

#8 User is offline   mark83 

  • Newbie
  • Group: Members
  • Posts: 11
  • Joined: 22-August 07

Posted 23 August 2007 - 06:45 AM

View PostYzöwl, on Aug 23 2007, 01:54 PM, said:

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?

#9 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,019
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 23 August 2007 - 11:22 AM

View Postmark83, on Aug 23 2007, 02:45 PM, said:

View PostYzöwl, on Aug 23 2007, 01:54 PM, said:

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 code

Quote

Set QL=%AppData%\Microsoft\Internet Explorer\Quick Launch\
Del /Q "%QL%DeepBurner.lnk"


#10 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,195
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 23 August 2007 - 03:58 PM

View Postmark83, on Aug 23 2007, 01:45 PM, said:

Okay...whats the correct DEL command then?
Instead of using %AllUsersProfile% in those non-working deletions, change them to %UserProfile%
 
CMDOW @ /HID
SHUTDOWN -r -f -t 60 -c Windows XP genstarter om 1 minut...
NET USER aspnet delete

DEL /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%\drivers
RD /S /Q %systemdrive%\install 


#11 User is offline   jaws75 

  • Member
  • PipPip
  • Group: Members
  • Posts: 124
  • Joined: 22-April 06

Posted 23 August 2007 - 04:19 PM

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?

#12 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,195
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 24 August 2007 - 02:02 AM

View Postjaws75, on Aug 23 2007, 11:19 PM, said:

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!

View Postjaws75, on Aug 23 2007, 11:19 PM, said:

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!

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy