Jump to content

Batch Files Getting Overrun


Recommended Posts

I'm working on an unattended WinXP Pro DVD with WPI 5.1 followup. For a number of program installations, I run a small batch file after the main installation command to clean up that program's start menu entries. Often, though the programs install correctly, the followup batch files don't run at all or don't finish. When I run them manually from the CD they function just fine. Also, I've checked the execution directories in my config.js and they're ok too. Does anyone have any ideas?

Appologies for the noobishness. Any help would be greatly appreciated.

Here's my Config.js file and one of the sample batches. Again, sometimes all of the commands in a batch file execute properly, sometimes none of them, sometimes only the first few.

firefox_start.bat:

cmdow @ /HID
@ECHO OFF

copy "%ALLUSERSPROFILE%\start menu\programs\Mozilla Firefox\Mozilla Firefox.lnk" "%ALLUSERSPROFILE%\start menu\programs\"
rmdir /S /Q "%ALLUSERSPROFILE%\start menu\programs\Mozilla Firefox\"

Edited by vampus8
Link to comment
Share on other sites


I don't think your problem is the batch file, but the installer.

I know I once tried to install a plugin for Firefox right after it installed.

You should adjust your batches so they wait for that link to be created then delete it.

Edited by sadicq
Link to comment
Share on other sites

thanks for the advice sadicq. so there's something specific about mozilla's installers? should i just add a sleep command at the start of the batch file?

it seems to be happening with other programs too, though. the batch file to copy windirstat also doesn't seem to consistely work, unless i run it directly.

cmdow @ /HID
@echo off

mkdir "c:\program files\WinDirStat\"
copy "%CDROM%\Software\Extras\WinDirStat\windirstat.exe" "c:\program files\WinDirStat\"
copy "%CDROM%\Software\Extras\WinDirStat\windirstat.lnk" "%AllUsersProfile%\Start Menu\Programs"

yesterday this created a windirstat directory in program files and didn't copy anything.

thanks in advance for the help.

kevin

Link to comment
Share on other sites

Ok ... that was not supposed to happen. About firefox I can say it behaves a little different from the others, but the one ... it is strange. I'll look into this when I have some time. Unfortunaly, I'm really busy these days, but you should also wait for the 5.3 version. I heard they are trying to fix a problem regarding batches, so stay tuned and read the other threads in this forum too.

Link to comment
Share on other sites

1) ok

2) would you though? they're just mkdir/copy/paste/delete commands for the most part. if it tries to copy something that isn't there, it won't hurt anything. if it repastes something that's already there, it'll just overwrite, if it mkdirs a directory that's already there, it won't change anythign, if it tries to delete somethign that's not there it'll just not do it. so it might increase my chances of actually getting it done, no? might give some interesting error codes in the wpi log but, the real test is only whether the start menu turns out right.

it's a dirty job fix, but might work?

thanks,

kevin

Edited by vampus8
Link to comment
Share on other sites

When looking in topic for bugs reports 5.2, there are 4 fixes to be made.

Make these fixes and your batches wil be done right, atleast for me it worked.

I use .cmd files for my start menu folder also, and that works fine.

Example of my .cmd that also starts WPI.

@ECHO OFF
REM Hide this command window.
%systemroot%\system32\cmdow.exe @ /hid

REM Example, how to look for CDROM-drive. Must have win51ip.SP2 at the root of the CD.
for %%i in (C 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:\win51ip.SP2 set CDROM=%%i:
echo Found CD-Rom as drive %CDROM%

set wpipath=%cdrom%\WPI

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

DEL "%systemdrive%\Documents and Settings\Administrator\Onlangs geopend\*.lnk"
DEL "%systemdrive%\Documents and Settings\Administrator\Menu Start\Programma's\QuickPar.lnk"
DEL "%systemdrive%\Documents and Settings\Administrator\Menu Start\Programma's\Uninstall.lnk"
DEL "%systemdrive%\Documents and Settings\Administrator\Menu Start\Programma's\Website.lnk"
DEL "%systemdrive%\Documents and Settings\Administrator\Menu Start\Programma's\TuneUp Utilities 2006.lnk"
DEL "%systemdrive%\Documents and Settings\Administrator\Menu Start\PowerArchiver.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\ICQ 5.1.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\WinRAR.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\WinZip.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\XstreamRadio 3.02.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Windows-catalogus.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Programma's\IncrediMail.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Programmatoegang en -instellingen.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Programma's\Windows Movie Maker.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Programma's\Adobe Reader 7.0.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Programma's\BearShare.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Programma's\Adobe ImageReady CS.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Programma's\Adobe Photoshop CS.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Programma's\Microsoft Office PowerPoint Viewer 2003.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Programma's\Orca.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Programma's\PerfectDisk 7.0.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Programma's\Nero\Handleiding voor Gebruikers\Nero BackItUp [Engelse Help].lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Programma's\Nero\Handleiding voor Gebruikers\Nero Burning ROM [Engelse Help].lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Programma's\Nero\Handleiding voor Gebruikers\Nero Cover Designer [Engelse Help].lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Programma's\Nero\Handleiding voor Gebruikers\Nero Express [Engelse Help].lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Programma's\Nero\Handleiding voor Gebruikers\Nero SoundTrax [Engelse Help].lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Menu Start\Programma's\Nero\Handleiding voor Gebruikers\Nero Wave Editor [Engelse Help].lnk"

DEL "%AllUsersProfile%\Bureaublad\*.lnk"
DEL /s/q "%userprofile%\Bureaublad\*.lnk"

DEL "%systemdrive%\Program Files\XstreamRadio 3.02\Flags\ireland.bmp"
DEL "%systemdrive%\Program Files\Registry Mechanic\ref\Deutsch.ini"
DEL "%systemdrive%\Program Files\Registry Mechanic\ref\Espanol.ini"
DEL "%systemdrive%\*.log"

DEL "%systemdrive%\Documents and Settings\Administrator\Cookies\*.txt"
DEL "%systemdrive%\Documents and Settings\Administrator\Cookies\*.tmp"

RD /S /Q %systemdrive%\"Program Files\Common Files\Microsoft Shared\DAO\ssdata\"
RD /S /Q %systemdrive%\"Documents and Settings\Administrator\Local Settings\Temporary Internet Files\"
RD /S /Q %systemdrive%\"Documents and Settings\Administrator\Local Settings\Geschiedenis\"
RD /S /Q %systemdrive%\"Macromedia Dreamweaver.v8 .0"\
RD /S /Q %systemdrive%\D\
RD /S /Q %systemdrive%\Install\
RD /S /Q %systemdrive%\RECYCLER\
RD /S /Q %systemroot%\"Temp\"

net user aspnet /delete

SET PP=%systemroot%\system32\WPI\
SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
REG ADD %KEY% /V TITLE /D "Resetten van het Beveiligingscentrum" /f
REG ADD %KEY%\001 /VE /D "Reset Windows Security Center" /f
REG ADD %KEY%\001 /V 1 /D "%PP%WinMgmt.cmd" /f

REM Herstarten van de PC binnen 30 seconden...
shutdown.exe -r -f -t 30 -c "Windows zal over 30 seconden worden herstart."

EXIT

Edited by Pliek
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...