wolfshade Posted June 8, 2004 Posted June 8, 2004 Well here it is -- i think this is the solution for rebooting and resuming silent mode batch in GUIRunOnce stage: 1.The computer logs in for the first time then it runs a GuiRunOnce batch. 2.At the end of the batch i add a line to copy the batch that will follow right after reboot then i use shutdown.exe for reboot in a line right after that. 3.Whats the catch? The copy command in the first batch will be for the batch after reboot and it will copy it to "C:\Documents and Settings\All Users\Start Menu\Programs\Startup" so after the system reboots the batch copied will start. 4.The last line in the start-up-batch will be a delete command that will delete the batch itself. 5.This can be done an infinite number of times every time u think u need a reboot after a silent install in your unattend --- just remember to add a copy line for the batch that comes after reboot in that path then delete the file itself so it doesn't start again at reboot again.in somewhat pseudocode:)batch in GuiRunOnce call: Command0=path\batch1batch1:1.your stuff TO DO here2.copy batch 2 that will start after reboot here(path\All Users\Start Menu\Programs\Startup)3.use shutdown.exe with its flags to restart heresystem reboots...start menu starts batch2batch2:1.your stuff TO DO here2.copy batchN that will start after reboot here(path\All Users\Start Menu\Programs\Startup)3.use shutdown.exe with its flags to restart here(use timer to allow the delete command to occur)4.delete curent batch(eg. del path-to-startup\batch2)system reboots...start menu starts batchNbatchN:1.your stuff TO DO here2.copy batch(n+1) that will start after reboot here(path\All Users\Start Menu\Programs\Startup)3.use shutdown.exe with its flags to restart here(use timer to allow the delete command to occur)4.delete curent batch(eg. del path-to-startup\batchN)Did u get the picture ? I didn't test it yet but it should work -- the only tricky part seems to be the shutdown and delete itself part.Any1 with more bright ideas of how this should be done please help here cuz i actually need this stuff.
Alanoll Posted June 8, 2004 Posted June 8, 2004 well, I must say, you put alot of thought into this. Me personally, I already knew (I messed with that startup folder along time ago, but i coudn't get certain things to load, but yeah....) but I'm others didn't. Thanks for sharing!You could do pretty much the same thing with RunOnceEX as well. As the last thing just before the shutdown command, import another set of entries, that overwrited all except for the shutdown one, and when it restarts, the next batch should go.
wolfshade Posted June 8, 2004 Author Posted June 8, 2004 Yeah - well i don't know how to use RunEx and i hear it more complicated than GUIRunOnce and cmdlines.txt combined(cmdlines doesn't work for me so far at all). It just struck me while looking at the TV, eating and feeling sorry for myself cuz of the horde of bugs i got in my unattend cuz of "need reboot" issues. After i will test this i will confirm that its 100% foolproof cuz i'm a lil uncertain about the shutdown>del itself stages in batch runs (logically it should make just calls and if the restart doesn't shut programs instantaneously then 2-3 seconds should be enough to allow the del itself command that comes after to take place).
Alanoll Posted June 8, 2004 Posted June 8, 2004 i wonder why cmdlines.txt doesn't work for you....RunOnceEX is harder, more possible errors in Synx if not done correctly (I'm a big fan of using an INF instead of Batch file....)
dennxyz Posted June 9, 2004 Posted June 9, 2004 HiFairly new to this site, but have gleaned a great deal so far and hopefully can put some useful info back. I run Windows 98 and 2000 on a dual boot and was looking for an update method that was relatively painless to adapt to either OS. I settled on the GuiRunOnce method with batches but have since moved to a combination CD/Hard drive update method. (Am going to try RunOnceEX soon)Anyway for GuiRunOnce method, the first batch starts when the OS boots.This batch copies a "run" batch to the start up folder, installs updates, then reboots.At the reboot, the batch in the startup folder calls the second update batch which copies second "run" batch to start up folder and deletes the first "run" batch. This can be repeated as many times as necessary and works on XP, 2000 and 98.My batch files for Windows 2000:In WINNT.sifBe sure to set Autologon to as many times as you need[GuiRunOnce] %systemdrive%\Install\GUI.cmd[GUI.cmd]CLS @echo offECHO.ECHO Copying RunM$Apps.cmd to Startup Folder...COPY "%systemdrive%\Install\RunM$Apps.cmd" "%systemdrive%\Documents and Settings\Administrator\Start Menu\Programs\Startup"ECHO.ECHO.ECHO Removing Welcome Screen at Logon...REGEDIT /S %systemdrive%\install\W2KREG.regEXIT[RunM$Apps.cmd]CLS @echo offECHO.ECHO Calling Microsoft DirectX & IE6 SP1 Batch File...ECHO.start %systemdrive%\Install\M$Apps.cmd EXITECHO.[M$Apps.cmd]CLS @echo offECHO.COPY "%systemdrive%\Install\RunHotfixes.cmd" "%systemdrive%\Documents and Settings\Administrator\Start Menu\Programs\Startup"ECHO.DEL "%systemdrive%\Documents and Settings\Administrator\Start Menu\Programs\Startup"\RunM$Apps.cmd"ECHO.ECHO.ECHO Installing Microsoft Updates and Applications...ECHO.ECHO.ECHO Installing DirectX 9.0 BECHO Please wait...start /wait %systemdrive%\install\DX9b\DX9NTopk.exeECHO.ECHO.ECHO Installing Internet Explorer 6 Service Pack 1...ECHO Please wait...start /wait %systemdrive%\install\ie6sp1\IE6SETUP.EXE /Q:A /R:NECHO.ECHO.ECHO Running Qchain...start /wait %systemdrive%\install\Hotfixes\Qchain.exeECHO.ECHO.ECHO Cleaning-Up Directory Structure...ECHO.ECHO Windows 2000 will restart in 60 Seconds...ECHO.ECHO DO NOT END BATCH FILE!!Sleep 60ECHO.wizmo rebootEXIT[RunHotfixes.cmd]CLS @echo offECHO.ECHO Calling Microsoft HotFixes Batch File...ECHO.start %systemdrive%\Install\Hotfixes.cmd EXIT[Hotfixes.cmd]CLS @echo offECHO.ECHO Installing Windows Hotfixes and Recommended Updates...ECHO.COPY "%systemdrive%\Install\CleanUp.cmd" "%systemdrive%\Documents and Settings\Administrator\Start Menu\Programs\Startup"ECHO.DEL "%systemdrive%\Documents and Settings\Administrator\Start Menu\Programs\Startup"\RunHotfixes.cmd"ECHO.ECHO.ECHO Installing Qfecheck...ECHO Command Prompt tool to verify status of HotfixesECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q282784.exe /q /m /n /zECHO.ECHO.ECHO Installing 329115 Security UpdateECHO Certificate Validation Flaw Could Enable Identity Spoofing...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q329115.exe /Q /O /N /ZECHO.ECHO.ECHO Installing 810217 Security UpdateECHO Buffer Overrun in MS FrontPage Server Extensions Could Allow Code Execution...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q810217.exe /Q /O /N /ZECHO.ECHO.ECHO Installing 814078 Security UpdateECHO JScript 5.6 Security Patch for Windows 2000...ECHO Please wait...start /wait %systemdrive%\install\hotfixes\js56nen.EXE /Q:A /R:NECHO.ECHO.ECHO Installing 818043 Security UpdateECHO Buffer Overrun in the Workstation Service Could Allow Code Execution...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q818043.exe /Q /O /N /ZECHO.ECHO.ECHO Installing 820888 Security UpdateECHO Computer hangs when it tries to mount an NTFS volume...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q820888.exe /Q /O /N /ZECHO.ECHO.ECHO Installing 822831 PatchECHO Driver Installation Program Does Not Install Device Drivers...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q822831.exe /Q /O /N /ZECHO.ECHO.ECHO Installing 823182 Security UpdateECHO Vulnerability in Authenticode Verification Could Allow Remote Code Execution...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q823182.exe /Q /O /N /ZECHO.ECHO.ECHO Installing 823559 Security UpdateECHO Buffer Overrun In HTML Converter Could Allow Code Execution...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q823559.exe /Q /O /N /ZECHO.ECHO.ECHO Installing 824105 Security UpdateECHO Flaw in NetBIOS Could Lead to Information Disclosure...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q824105.exe /Q /O /N /ZECHO.ECHO.ECHO Installing 825119 Security UpdateECHO Buffer Overrun in Help and Support Center Could Lead to System Compromise...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q825119.exe /Q /O /N /ZECHO.ECHO.ECHO Installing 826232 Security UpdateECHO Buffer Overflow in Troubleshooter ActiveX Control Could Allow Code Execution...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q826232.exe /Q /O /N /ZECHO.ECHO.ECHO Installing 828026 Security UpdateECHO Update for Windows Media Player URL Script Command Behavior...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q828026.exe /Q /O /N /ZECHO.ECHO.ECHO Installing 828035 Security UpdateECHO Buffer Overrun in Messenger Service Could Allow Code Execution...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q828035.exe /Q /O /N /ZECHO.ECHO.ECHO Installing 828741 Critical UpdateECHO Security Issue in Windows Could Allow Remote Take Over...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q828741.exe /quiet /O /N /norestartECHO.ECHO.ECHO Installing 828749 Security UpdateECHO Buffer Overrun in the Workstation Service Could Allow Code Execution...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q828749.exe /Q /O /N /ZECHO.ECHO.ECHO Installing 832353 PatchECHO Fix: Some Script Commands Do Not Work After Applying WMP Patch 828026...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q832353.exe /quiet /O /N /norestartECHO.ECHO.ECHO Installing 832483 Critical UpdateECHO Buffer overrun in MDAC function Could Allow Code Execution...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q832483.exe /C:"dahotfix.exe /q /n" /qECHO.ECHO.ECHO Installing 832894 Critical UpdateECHO February 2, 2004 Cumulative Update for IE6 SP1...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q832894.exe /q:a /r:n ECHO.ECHO.ECHO Installing 831167 UpdateECHO Update for Internet Explorer 6 Service Pack 1...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q831167.exe /Q:A /R:NECHO.ECHO.ECHO Installing 835732 Critical UpdateECHO Multiple Security Issues in Windows Could Allow Remote Take Over...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q835732.exe /quiet /O /N /norestartECHO.ECHO.ECHO Installing 837001 Critical UpdateECHO Security Issue in Windows Could Allow Remote Take Over...ECHO Please wait...start /wait %systemdrive%\install\Hotfixes\Q837001.exe /quiet /O /N /norestartECHO.ECHO.ECHO Installing 837009 PatchECHO Cumulative Patch for Outlook Express...ECHO Please wait...start /wait %systemdrive%\install\hotfixes\q837009.exe /Q:A /R:NECHO.ECHO.ECHO Running Qchain...start /wait %systemdrive%\install\Hotfixes\Qchain.exeECHO.ECHO.ECHO Cleaning-Up Directory Structure...ECHO.ECHO Windows 2000 will restart in 60 Seconds...ECHO.ECHO DO NOT END BATCH FILE!!Sleep 60ECHO.wizmo rebootEXIT[Cleanup.cmd]CLS@echo offECHO.ECHO.ECHO.ECHO.ECHO.ECHO.ECHO.DEL "%systemdrive%\WINNT\system32\pskill.exe"DEL "%systemdrive%\WINNT\system32\sleep.exe"DEL "%systemdrive%\WINNT\system32\wizmo.exe"RD /S /Q %systemdrive%\installDEL /S /Q %.\Cleanup.cmdXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXNote that "Wizmo" is a free app from www.grc.com, copies over in "System32" folder.dennxyz
wolfshade Posted June 9, 2004 Author Posted June 9, 2004 I tested the shutdown and delete itself section here's the test:ECHO Restarting the PCshutdown.exe -r -f -t 0ECHO Deleting itselfdel c:\test.cmd Put this test.cmd on c:\ or modify the path. U might want to test this on your machine first -- maybe its slower and won't initiate the del itself part in "-t 0" but "-t 1" (check out flags for shutdown.exe /?).
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now