Jump to content

last commands in main batch dont work


Recommended Posts

I have 2 batch file..

first_boot.cmd

CLS
@echo off
ECHO.
ECHO Removing Wallpapers and Screensavers...
DEL "%systemroot%\*.bmp"
DEL "%systemroot%\Web\Wallpaper\*.jpg"
DEL "%systemroot%\system32\dllcache\*.scr"
DEL "%systemroot%\system32\*.scr"

ECHO.
ECHO Removing useless 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 Applying Registry Tweaks...
REGEDIT /S %systemdrive%\install\RegTweaks.reg

ECHO.
ECHO Copying patched UXTheme.dll...
REN %systemroot%\System32\uxtheme.dll uxtheme.old
COPY "%systemdrive%\Install\uxtheme\uxtheme.dll" "%systemroot%\System32\"

ECHO.
ECHO Copying PSKill.exe...
COPY "%systemdrive%\Install\Tools\pskill.exe" "%systemroot%"

CLS
@ECHO OFF
ECHO.
ECHO Ejecting CD-ROM Drives...
ECHO If you are using a cd rom please remove it from
ECHO the cdrom drive and If you have a second cd place
ECHO it in the drive at this time please.
ECHO.
ECHO If you are using a dvd please remove it
ECHO at this time.
ECHO.
ECHO Wait till the cdrom/dvd drive quits blinking
ECHO and then ...
start cscript %systemdrive%\install\Tools\cd_eject.vbs >null
PSKill cscript.exe >null
ECHO.
PAUSE

IF EXIST %systemdrive%\install\applications.cmd GOTO APPS
SET CDROM2=
IF EXIST D:\install\applications.cmd SET CDROM2=D:
IF EXIST E:\install\applications.cmd SET CDROM2=E:
IF EXIST F:\install\applications.cmd SET CDROM2=F:
IF EXIST G:\install\applications.cmd SET CDROM2=G:
IF EXIST H:\install\applications.cmd SET CDROM2=H:
IF EXIST I:\install\applications.cmd SET CDROM2=I:
IF EXIST J:\install\applications.cmd SET CDROM2=J:
IF EXIST K:\install\applications.cmd SET CDROM2=K:

IF NOT EXIST %CDROM2%\install\applications.cmd GOTO APPS

:APPS
ECHO Running Applications Batch ...
ECHO.
start /wait %CDROM2%\install\applications.cmd

ECHO Moving programs shortcuts ...
ECHO.
MOVE /y "%systemdrive%\Documents and Settings\All Users\Desktop\*.lnk" "%systemdrive%\Documents and Settings\All Users\Desktop\Programs\"

ECHO.
ECHO Deleting Temp Installation Files...
RD /S /Q %systemdrive%\Install
RD /S /Q %systemdrive%\Drivers

ECHO.
ECHO Restarting the PC in 1 minute...
shutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute, this will give enough time for the shortcuts to update and for the shell to fully load before its ready to restart!"

EXIT

and applications.cmd (Second CD)

CLS
@echo off
ECHO.
ECHO Installing Office 2003 Professional Hebrew Edition
ECHO Please wait...
start /wait %CDROM2%\install\Applications\Office2003\setup.exe TRANSFORMS=Unattended.MST /qb-

ECHO.
ECHO Installing ICQ Lite 4.0 Build #1646 + Patch
ECHO Please wait...
start /wait %CDROM2%\install\Applications\IcqLite4\icq4.exe /S
pskill icqlite.exe

ECHO.
ECHO Installing Ad-Aware SE Personal Build 1.03
ECHO Please wait...
start /wait %CDROM2%\install\Applications\AdAwareSE\Adaware-SE.msi /passive /n
pskill Adaware.exe
pskill hh.exe
pskill Ad-Aware.exe

ECHO.
ECHO Installing Daemon Tools 3.33
ECHO Please wait...
start /wait %CDROM2%\install\Applications\DaemonTools\daemon.msi /q /passive /norestart

ECHO.
ECHO Installing DivX 5.2
ECHO Please wait...
start /wait %CDROM2%\install\Applications\DivX52\DivX52.exe /S

ECHO.
ECHO Installing FlashGet 1.60a
ECHO Please wait...
start /wait %CDROM2%\install\Applications\FlashGet160\fgf160a.exe /S

ECHO.
ECHO Installing FlashFXP 3.0 Final
ECHO Please wait...
start /wait %CDROM2%\install\Applications\FlashFxp3\FlashFXP30.exe /Silent

ECHO.
ECHO Registering FlashFXP 3.0 Final
ECHO Please wait...
copy /y "%CDROM2%\install\Applications\FlashFxp3\flashfxp.key" "%systemdrive%\Progra~1\FlashFXP\"

ECHO.
ECHO Installing Ahead Nero Burning Rom 6.3
ECHO Please wait...
start /wait %CDROM2%\install\Applications\Nero6\nero63117.exe /silent /noreboot

ECHO.
ECHO Registering Ahead Nero Burning Rom 6.3
ECHO Please wait...
REGEDIT /S %CDROM2%\install\Applications\Nero6\regnero.reg

ECHO.
ECHO Installing WinRar 3.40 Beta 4
ECHO Please wait...
start /wait %CDROM2%\install\Applications\WinRar34b4\wrar34b4.exe /s

ECHO.
ECHO Installing UltraISO 7.21 SR-2
ECHO Please wait...
start /wait %CDROM2%\install\Applications\UltraISO7\uiso7_me.exe /VERYSILENT /SP-

ECHO.
ECHO Registering UltraISO 7.21 SR-2
ECHO Please wait...
REGEDIT /S %CDROM2%\install\Applications\UltraISO7\reg.reg

ECHO.
ECHO Installing Serv-U 5.1
ECHO Please wait...
start /wait %CDROM2%\install\Applications\ServU51\susetup.exe /s
pskill servua~1.exe
pskill servut~1.exe

ECHO.
ECHO Registering Serv-U 5.1
ECHO Please wait...
copy /y "%CDROM2%\install\Applications\ServU51\ServUCert.key" "%systemdrive%\Progra~1\Serv-U\"

EXIT

The problem is that when its done do applications.cmd batch its done and dont do last commands in first_boot.cmd, This commands:

ECHO Moving programs shortcuts ...
ECHO.
MOVE /y "%systemdrive%\Documents and Settings\All Users\Desktop\*.lnk" "%systemdrive%\Documents and Settings\All Users\Desktop\Programs\"

ECHO.
ECHO Deleting Temp Installation Files...
RD /S /Q %systemdrive%\Install
RD /S /Q %systemdrive%\Drivers

ECHO.
ECHO Restarting the PC in 1 minute...
shutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute, this will give enough time for the shortcuts to update and for the shell to fully load before its ready to restart!"

EXIT

Hmm whats problem?

Link to comment
Share on other sites


first of all u need remove the - " that u put after the *.ink" and the one b4 the move path like this :

MOVE /y "%systemdrive%\Documents and Settings\All Users\Desktop\*.lnk %systemdrive%\Documents and Settings\All Users\Desktop\Programs\"

second, with RD command u can't remove a full folder, u can only remove an

empty folder with RD command.

Link to comment
Share on other sites

second, with RD command u can't remove a full folder, u can only remove an

empty folder with RD command.

ummm, no :P lol

RD /S /Q "path\to\folder" it doesnt care whats in the folder, it will remove it

Link to comment
Share on other sites

RD /S /Q %systemdrive%\Install should be the last command executed in your batch, especially if your batch files are in the install directory otherwise any commands after that will not be executed because the batch file has been deleted...

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