Jump to content

Help with my cleanup.cmd


Recommended Posts

Ok i have been using my cleanup.cmd for a long time along with my UACD of xp sp2. For some reason i must have changed something because now after installing an update it restarts. I do not know why this is because i have not changed any switches.

cmdow @ /dis
@echo off
TITLE Windows XP SP2 - Unattended Software Installs and System Cleanup

setlocal
set PATHTOFILE=%systemdrive%\Post-Installs
CLS

ECHO.
ECHO At this time Microsoft .NET Framework 3.0 will be installed.
ECHO System cleanup will also be performed. This could take 15
ECHO minutes or more. When this process has finished, this window
ECHO will close and you may begin using Windows.

ECHO.
ECHO WARNING: Do NOT press any keys until this window has closed!

ECHO.
ECHO.
ECHO Installing Microsoft .NET Framework 3.0
ECHO Please wait...
start /wait %PATHTOFILE%\NETfrmwrk3.exe /q /norestart
ECHO Done!

ECHO.
ECHO Installing Microsoft .NET Framework 1.1 Hotfix - (1 of 3)
ECHO Please wait...
start /wait %PATHTOFILE%\KB928366-NET1.1-Fix.exe /Q
ECHO Done!

ECHO.
ECHO Installing Microsoft .NET Framework 2.0 Hotfix - (2 of 3)
ECHO Please wait...
start /wait %PATHTOFILE%\KB928365-NET2-Fix.exe /Q *** reboots after installing or near the end of installing this patch****
ECHO Done!

ECHO.
ECHO Installing Microsoft .NET Framework 3.0 Hotfix - (3 of 3)
ECHO Please wait...
start /wait %PATHTOFILE%\KB932471-NET3-Fix.exe /Q
ECHO Done!

ECHO.
ECHO.
ECHO Customizing the Start Menu
DEL "%systemdrive%\Documents and Settings\Default User\Start Menu\Programs\Windows Media Player.lnk"
DEL "%UserProfile%\Start Menu\Programs\Outlook Express.lnk"
MOVE "%UserProfile%\Start Menu\Programs\Internet Explorer.lnk" "%AllUsersProfile%\Start Menu"
MOVE "%UserProfile%\Start Menu\Programs\Windows Media Player.lnk" "%AllUsersProfile%\Start Menu"
MOVE "%systemdrive%\Version Installed*.lnk" "%AllUsersProfile%\Start Menu"
ECHO Done!

ECHO.
ECHO Customizing Quick Launch Toolbar
MOVE "%systemdrive%\Show Desktop.scf" "%UserProfile%\Application Data\Microsoft\Internet Explorer\Quick Launch"
IF EXIST D:/ MOVE "%systemdrive%\Media Disk.lnk" "%UserProfile%\Application Data\Microsoft\Internet Explorer\Quick Launch"
DEL "%UserProfile%\Application Data\Microsoft\Internet Explorer\Quick Launch\Launch Internet Explorer Browser.lnk"
ECHO Done!

ECHO.
ECHO Importing Registry Tweaks
REGEDIT /S "%PATHTOFILE%\FirstBoot_Tweaks.reg"
ECHO Done!

ECHO.
ECHO Performing System Cleanup
ATTRIB +H "%programfiles%\xerox"
DEL "%UserProfile%\Software*.log"
DEL "%WinDir%\system32\$winnt$.inf"
RD /S /Q "%UserProfile%\Favorites\Links"
RD /S /Q "%UserProfile%\Favorites\Microsoft Websites"
RD /S /Q "%programfiles%\MSXML 4.0"
RD /S /Q "%programfiles%\MSXML 6.0"
RD /S /Q "%AllUsersProfile%\Documents\My Music\Sample Playlists"
RD /S /Q "%AllUsersProfile%\Documents\My Music\Sync Playlists"
RD /S /Q "%systemdrive%\Post-Installs"
ECHO Done!

DEL /F "%AllUsersProfile%\Start Menu\Programs\Startup\Cleanup.cmd"

thanks for the help

sorry i dont know how to put my code in a scroll bar...

Edited by cumminbk
Link to comment
Share on other sites


Try to add the /Z switch to the "problematic" patch:

ECHO Please wait...

start /wait %PATHTOFILE%\KB928365-NET2-Fix.exe /Q /Z *** reboots after installing or near the end of installing this patch****

ECHO Done!

/Z means "no restart", actually superseded by the new "/norestart" switch. Both have the same effect.

Link to comment
Share on other sites

i guess i should try that the only reason i didnt before is because when i run /? on the patch it does not show that /z is an acceptable switch. plus when i install the patch without any switches it installs fine and does not prompt for a reboot... that is what confuses me.

I will try what you suggested but in the mean time does anybody else install this patch and if so how do they do it? It doesnt support intergartion

Link to comment
Share on other sites

Ok, you're right. I see the patch is for .NET Framework 2.0, the "infamous" KB928365, the hardest patch to integrate in the .NET 2.0 installation, believe me (see my last posts in the Silent .NET Maker of Tomcat76 if and you'll understand).

Since .NET 2.0 installation is driven by Windows Installer, you could try Windows Installer directives passed as arguments (a.k.a "public properties").

Try the following directive:

REBOOT=S

And this one:

REBOOT=R (more agressive, suppress all kinds of reboots).

Edited by ponghy
Link to comment
Share on other sites

  • 2 weeks later...

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...