Jump to content

Cleanup commande problem


Recommended Posts

At the end of my runonceex.cmd, i run my clean.cmd which is the following:

cmdow @ /HID
net user aspnet /delete

RD /S /Q "%AllUsersProfile%\Start Menu\Programs\PrintMe Internet Printing"
RD /S /Q "%AllUsersProfile%\Start Menu\Programs\Java Web Start"

DEL "%systemroot%\*.bmp"
DEL "%systemroot%\Web\Wallpaper\*.jpg"
DEL "%systemroot%\system32\dllcache\*.scr"
DEL "%systemroot%\system32\*.scr"

DEL "%AllUsersProfile%\Start Menu\Windows Update.lnk"
DEL "%AllUsersProfile%\Start Menu\Set Program Access and Defaults.lnk"
DEL "%AllUsersProfile%\Start Menu\Windows Catalog.lnk"

shutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute..."

EXIT

but it doesn't reboot my Pc at the end. The screen just stays blue and i have to do a ctrl-alt-del and run explorer so i can do a reboot(after the reboot everything works). The last app to install in my runonce is PC Anywhere and it needs the Pc to reboot in order to finish the installation...could that be related to me problem? Here is the code for my runonceex.cmd for PC anywhere and my clean.cmd:

REG ADD %KEY%\042 /VE /D "Pc Anywhere 10.5" /f
REG ADD %KEY%\042 /V 1 /D "%cdrom%\Apps\pcanywhere\pcanywhere10.5.msi /qb- REBOOT=ReallySuppress" /f
REG ADD %KEY%\042 /V 2 /D "taskkill /F /IM pca_run.exe" /f

REG ADD %KEY%\043 /VE /D "Cleanup" /f
REG ADD %KEY%\043 /V 1 /D "%cdrom%\Apps\Clean\clean.cmd /f

EXIT

What could be the problem? and on another note, I have a wallpaper folder that i wanted to copy to My Documents\My Pictures\Wallpapers. I put my folder in

$OEM$\$DOCS\Saitoh\My Documents\My Pictures\Wallpapers

but it doesn't copy. I also tried to copy with $OEM$\1$\Wallpaper but it still doesn't copy....

Link to comment
Share on other sites


what app did you use to edit your cmd files. I love pspad but it defaults to unicode for everything (cmd files require ansi) and when I create cmd files with it or even if I edit my cmd files using pspad it will trash them. I have to copy the text out of it and past it into plain old notepad then save it again with notepad.

I spent quite a few days trying to figure out why my scritps kept failing. The scipts whould start but they would jsut stop running and quit. It was quite frustrating.

Link to comment
Share on other sites

I use Notepad2 and the files are in ANSI. The runconceex.cmd runs fine, it the clean.cmd thats the prob. It removes the shorcuts but doesnt reboot. Here is another version of my clean.cmd file

cmdow @ /HID
net user aspnet /delete

RD /S /Q "%AllUsersProfile%\Start Menu\Programs\PrintMe Internet Printing"
RD /S /Q "%AllUsersProfile%\Start Menu\Programs\Java Web Start"

DEL "%systemroot%\*.bmp"
DEL "%systemroot%\Web\Wallpaper\*.jpg"
DEL "%systemroot%\system32\dllcache\*.scr"
DEL "%systemroot%\system32\*.scr"

DEL "%AllUsersProfile%\Start Menu\Windows Update.lnk"
DEL "%AllUsersProfile%\Start Menu\Set Program Access and Defaults.lnk"
DEL "%AllUsersProfile%\Start Menu\Windows Catalog.lnk"

DEL "%AllUsersProfile%\Start Menu\Programs\Windows Movie Maker.lnk"

DEL "%AllUsersProfile%\Desktop\Java Web Start.lnk"
DEL "%AllUsersProfile%\Desktop\Adobe Reader 6.0.2 lnk"

DEL "%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"

DEL "%systemdrive%\tmpgenc.log"
RD "%systemdrive%\Program Files\Movie Maker\"
RD "%systemdrive%\Program Files\Microsoft Frontpage\"
RD "%systemdrive%\Program Files\Complus Applications\"
RD /S /Q "%systemroot%\Cache\Adobe Reader 6\"
DEL "%UserProfile%\My Documents\Creativity_Pack_ReadMe.htm"
deltree "%systemdrive%\Program Files\Online Services\"
copy "%cdrom%\Apps\wallpaper\GW\*.*" "%UserProfile%\My Documents\My Pictures\wall
copy "%cdrom%\Apps\wallpaper\wall\*.*" "%UserProfile%\My Documents\My Pictures\wall

shutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute..."

EXIT

Is there anything wrong with it? I even tried putting this

shutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute..."

at the beginning and it changes nothing.

Link to comment
Share on other sites

if u want to copy ur wallpapers.then u shld place them at root\$OEM$\$$\Web\Wallpaper\bliss.jpg.

and abt ur shutdown command it is right.have a look at my install.cmd

CMDOW @ /HID

@ECHO OFF

start /wait %cdrom%\install\wpi\WPI.hta

start /wait shutdown.exe -r -f -t 30 -c "This System Must Reboot now. This Is necessary for applications to complete installation, shortcuts to updated"

exit

i just tested ur cleanup.cmd.its working nice for me.i think ur calling it wrong.check once again.

Edited by bmn
Link to comment
Share on other sites

@bmn

In my cleanup.cmd there is a line to del all jpg in the \web\wallpaper. Is it possible to add a line in my clean.cmd to copy the folder over to the directory of my choosing and if so what is the syntax? Also which of my cmd did you try?

@Tsunami

Do i have to copy the shutdown.exe to my \$OEM$\$$\system32 folder on my CD

Link to comment
Share on other sites

Do i have to copy the shutdown.exe to my \$OEM$\$$\system32 folder on my CD

If you want it to be copied to windows\system32 directory and then being able to use it without specifying absolute paths. You could of course copy it to any location on your HD and then specify its path in the cmd-file but it's easier if you just place it in that folder.

So, in short, yes.

*EDIT*

Does the program work if you start it manually with that commandline? If so, then the cmd-file probably can't just find it and it will be remedied by the solution above.

Link to comment
Share on other sites

@saitoh183 & Gagorian: No, you DON'T have to copy the file to $OEM$\$$\system32, simply because the file is already there when you install Windows. If you don't believe me, look for shutdown.ex_ go to your I386 dir.

Windows 2000 doesn't have it. So, no I don't believe you. ;)

(Yeah, I didn't really pay notice that he was using XP.)

Okay, if shutdown.exe doesn't work (did you try running it from the start -> run?) you could try a few of the other alternatives you have. I personally use poweroff.exe (it doesn't look like an error message!)

I use the following commandline with it:

poweroff.exe reboot -force -nocancel -warn -warntime 25 -msg "Windows 2000 will now restart in 25 seconds for the installation to be complete."

You can get it from http://users.pandora.be/jbosman/poweroff/poweroff.htm

Place the poweroff.exe to the $OEM$\$$\system32 folder and then make your batch run that commandline. It should work.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...