Jump to content

Batch troubles (can't figure it out)


Recommended Posts

I have been tweaking my winxp cd (typos etc., files names different from batches :), etc.) and I still have a problem. I have tried and tried and still with no luck can't figure it out.

My winnt.sif

[GuiRunOnce]%systemdrive%\installs\apps.bat

%systemdrive%\installs\updates.bat

%systemdrive%\installs\hotfixes.bat

%systemdrive%\installs\cleanup.bat

My apps.bat, updates.bat and hotfixes.bat run fine with no problems. It is cleanup.bat where all my problems are occuring.

@ECHO OFF

ECHO.

ECHO Applying registry changes

start %systemdrive%\installs\Reg_chng\stat_bar.vbs

REGEDIT /S %systemdrive%\installs\reg_chng\RegTweaks.reg

REGEDIT /S %systemdrive%\installs\reg_chng\sys_serv.reg

ECHO.

ECHO Installing personal themes

XCOPY "%systemdrive%\Installs\Themes\* /s "%systemroot%\Resources\Themes"

ECHO.

ECHO Removing default wallpapers and adding personal ones

DEL "%systemroot%\Web\Wallpaper\*.jpg"

XCOPY "%systemdrive%\Installs\W_Paper\*.jpg %systemroot%\Web\Wallpaper

ECHO.

ECHO Removing screensavers:

DEL "%systemroot%\system32\dllcache\scrnsave.scr"

DEL "%systemroot%\system32\dllcache\ss3dfo.scr"

DEL "%systemroot%\system32\dllcache\ssbezier.scr"

DEL "%systemroot%\system32\dllcache\ssflwbox.scr"

DEL "%systemroot%\system32\dllcache\ssmarque.scr"

DEL "%systemroot%\system32\dllcache\ssmypics.scr"

DEL "%systemroot%\system32\dllcache\ssmyst.scr"

DEL "%systemroot%\system32\dllcache\sspipes.scr"

DEL "%systemroot%\system32\dllcache\ssstars.scr"

DEL "%systemroot%\system32\dllcache\sstext3d.scr"

DEL "%systemroot%\system32\scrnsave.scr"

DEL "%systemroot%\system32\ss3dfo.scr"

DEL "%systemroot%\system32\ssbezier.scr"

DEL "%systemroot%\system32\ssflwbox.scr"

DEL "%systemroot%\system32\ssmarque.scr"

DEL "%systemroot%\system32\ssmypics.scr"

DEL "%systemroot%\system32\ssmyst.scr"

DEL "%systemroot%\system32\sspipes.scr"

DEL "%systemroot%\system32\ssstars.scr"

DEL "%systemroot%\system32\sstext3d.scr"

ECHO.

ECHO Removing Start menu shortcuts...

DEL "%systemdrive%\Documents and Settings\All Users\Start Menu\Windows Update.lnk"

DEL "%systemdrive%\Documents and Settings\All Users\Start Menu\Set Program Access and Defaults.lnk"

DEL "%systemdrive%\Documents and Settings\All Users\Start Menu\Windows Catalog.lnk"

ECHO.

ECHO Removing Temporary installation files C:\Installs and C:\Drivers

RD /S /Q %Systemdrive%\Installs

RD /S /Q %Systemdrive%\Drivers

ECHO.

ECHO Windows XP will now restart in 1 minute

shutdown.exe -r -f -t 60

EXIT

I don't believe that my RegTweaks.reg was run, but my stat_bar.vbs seemed to work (at least the popbox showed up).

As for my themes being copied, nope doesn't happen. They are in Installs\Themes\Sub Dir for each theme and they don't get copied.

The default wallpapers I believe have been deleted, but my wallpapers aren't copied over. They are in Installs\W_paper\(various jpgs = not a file, just stating that I have jpgs in that folder).

Screensavers are gone!

Menu shortcuts have been deleted!

The folder Installs is deleted, but not drivers.

and shutdown.exe doens't work. (yet, if I double click my batch file, the 60 sec countdown works).

Any ideas why these things are occuring. (I checked spelling, I can't see it being that).

Thanks

]Bonkers[

Link to comment
Share on other sites


Not sure if any of this will help Bonkers...but I'll try...

Themes:

For XCOPY, try using "XCOPY /E /Q" before your target.... (not sure what that is, but AaronXP told me to use that and it works)

Reg Tweaks:

Reg Tweaks sure looks right from here...can you confirm that it hasn't run for sure?

Shutdown.exe:

Do you have a nic card? I use psshutdown, and it works great...

Sorry I can't be of more help :)

Link to comment
Share on other sites

A little update... I changed xcopy to XCOPY /E /Q (thanks bigred for the idea. I will implement that on my next try and give an update).

Also, bigred, thanks for the help on my regtweaks ( :) ) (it was my error, a typo at almost 3 AM, OMG! how did I miss it).

I do have a nic card, and the drivers work. If I double click cleanup.bat, shutdown.exe works... so I am not sure why it is missing it during the unattended mode.

Anyone: any ideas why my second dir, Drivers, isn't deleted. I check spelling (copied and pasted folder names to be 100% sure).

Thanks

]Bonkers[

Link to comment
Share on other sites

My Drivers folder didn't get deleted either, I assume its in use by Windows.

You're familiar with the RunOnce registry key, so you can create a cmd file to wipe the Drivers folder on the next reboot.

Link to comment
Share on other sites

for your shutdown.exe try adding the path to the file in your batch.

for anyone who wants to know about the xcopy syntax commands....

/E Copies directories and sub directories, including empty ones.

/Q Does not display file names while copying

Link to comment
Share on other sites

AaronXP: good idea, but how do I delete the batch file that deletes the folders :S

What I have done is, took the deleting of the folders out, and created a reg in Runone to delete my two folders (Installs, Drivers) after my reboot. But how do I delete the bat file after it deletes :) ?

Thanks

]Bonkers[

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