Jump to content

Recommended Posts

Posted

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\batch1

batch1:

1.your stuff TO DO here
2.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 here

system reboots...

start menu starts batch2

batch2:

1.your stuff TO DO here
2.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 batchN

batchN:

1.your stuff TO DO here
2.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.


Posted

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.

Posted

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

Posted

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

Posted

Hi

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

Be sure to set Autologon to as many times as you need

[GuiRunOnce]

%systemdrive%\Install\GUI.cmd

[GUI.cmd]

CLS

@echo off

ECHO.

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

EXIT

[RunM$Apps.cmd]

CLS

@echo off

ECHO.

ECHO Calling Microsoft DirectX & IE6 SP1 Batch File...

ECHO.

start %systemdrive%\Install\M$Apps.cmd

EXIT

ECHO.

[M$Apps.cmd]

CLS

@echo off

ECHO.

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 B

ECHO Please wait...

start /wait %systemdrive%\install\DX9b\DX9NTopk.exe

ECHO.

ECHO.

ECHO Installing Internet Explorer 6 Service Pack 1...

ECHO Please wait...

start /wait %systemdrive%\install\ie6sp1\IE6SETUP.EXE /Q:A /R:N

ECHO.

ECHO.

ECHO Running Qchain...

start /wait %systemdrive%\install\Hotfixes\Qchain.exe

ECHO.

ECHO.

ECHO Cleaning-Up Directory Structure...

ECHO.

ECHO Windows 2000 will restart in 60 Seconds...

ECHO.

ECHO DO NOT END BATCH FILE!!

Sleep 60

ECHO.

wizmo reboot

EXIT

[RunHotfixes.cmd]

CLS

@echo off

ECHO.

ECHO Calling Microsoft HotFixes Batch File...

ECHO.

start %systemdrive%\Install\Hotfixes.cmd

EXIT

[Hotfixes.cmd]

CLS

@echo off

ECHO.

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 Hotfixes

ECHO Please wait...

start /wait %systemdrive%\install\Hotfixes\Q282784.exe /q /m /n /z

ECHO.

ECHO.

ECHO Installing 329115 Security Update

ECHO Certificate Validation Flaw Could Enable Identity Spoofing...

ECHO Please wait...

start /wait %systemdrive%\install\Hotfixes\Q329115.exe /Q /O /N /Z

ECHO.

ECHO.

ECHO Installing 810217 Security Update

ECHO Buffer Overrun in MS FrontPage Server Extensions Could Allow Code Execution...

ECHO Please wait...

start /wait %systemdrive%\install\Hotfixes\Q810217.exe /Q /O /N /Z

ECHO.

ECHO.

ECHO Installing 814078 Security Update

ECHO JScript 5.6 Security Patch for Windows 2000...

ECHO Please wait...

start /wait %systemdrive%\install\hotfixes\js56nen.EXE /Q:A /R:N

ECHO.

ECHO.

ECHO Installing 818043 Security Update

ECHO Buffer Overrun in the Workstation Service Could Allow Code Execution...

ECHO Please wait...

start /wait %systemdrive%\install\Hotfixes\Q818043.exe /Q /O /N /Z

ECHO.

ECHO.

ECHO Installing 820888 Security Update

ECHO Computer hangs when it tries to mount an NTFS volume...

ECHO Please wait...

start /wait %systemdrive%\install\Hotfixes\Q820888.exe /Q /O /N /Z

ECHO.

ECHO.

ECHO Installing 822831 Patch

ECHO Driver Installation Program Does Not Install Device Drivers...

ECHO Please wait...

start /wait %systemdrive%\install\Hotfixes\Q822831.exe /Q /O /N /Z

ECHO.

ECHO.

ECHO Installing 823182 Security Update

ECHO Vulnerability in Authenticode Verification Could Allow Remote Code Execution...

ECHO Please wait...

start /wait %systemdrive%\install\Hotfixes\Q823182.exe /Q /O /N /Z

ECHO.

ECHO.

ECHO Installing 823559 Security Update

ECHO Buffer Overrun In HTML Converter Could Allow Code Execution...

ECHO Please wait...

start /wait %systemdrive%\install\Hotfixes\Q823559.exe /Q /O /N /Z

ECHO.

ECHO.

ECHO Installing 824105 Security Update

ECHO Flaw in NetBIOS Could Lead to Information Disclosure...

ECHO Please wait...

start /wait %systemdrive%\install\Hotfixes\Q824105.exe /Q /O /N /Z

ECHO.

ECHO.

ECHO Installing 825119 Security Update

ECHO 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 /Z

ECHO.

ECHO.

ECHO Installing 826232 Security Update

ECHO Buffer Overflow in Troubleshooter ActiveX Control Could Allow Code Execution...

ECHO Please wait...

start /wait %systemdrive%\install\Hotfixes\Q826232.exe /Q /O /N /Z

ECHO.

ECHO.

ECHO Installing 828026 Security Update

ECHO Update for Windows Media Player URL Script Command Behavior...

ECHO Please wait...

start /wait %systemdrive%\install\Hotfixes\Q828026.exe /Q /O /N /Z

ECHO.

ECHO.

ECHO Installing 828035 Security Update

ECHO Buffer Overrun in Messenger Service Could Allow Code Execution...

ECHO Please wait...

start /wait %systemdrive%\install\Hotfixes\Q828035.exe /Q /O /N /Z

ECHO.

ECHO.

ECHO Installing 828741 Critical Update

ECHO Security Issue in Windows Could Allow Remote Take Over...

ECHO Please wait...

start /wait %systemdrive%\install\Hotfixes\Q828741.exe /quiet /O /N /norestart

ECHO.

ECHO.

ECHO Installing 828749 Security Update

ECHO Buffer Overrun in the Workstation Service Could Allow Code Execution...

ECHO Please wait...

start /wait %systemdrive%\install\Hotfixes\Q828749.exe /Q /O /N /Z

ECHO.

ECHO.

ECHO Installing 832353 Patch

ECHO 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 /norestart

ECHO.

ECHO.

ECHO Installing 832483 Critical Update

ECHO Buffer overrun in MDAC function Could Allow Code Execution...

ECHO Please wait...

start /wait %systemdrive%\install\Hotfixes\Q832483.exe /C:"dahotfix.exe /q /n" /q

ECHO.

ECHO.

ECHO Installing 832894 Critical Update

ECHO 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 Update

ECHO Update for Internet Explorer 6 Service Pack 1...

ECHO Please wait...

start /wait %systemdrive%\install\Hotfixes\Q831167.exe /Q:A /R:N

ECHO.

ECHO.

ECHO Installing 835732 Critical Update

ECHO Multiple Security Issues in Windows Could Allow Remote Take Over...

ECHO Please wait...

start /wait %systemdrive%\install\Hotfixes\Q835732.exe /quiet /O /N /norestart

ECHO.

ECHO.

ECHO Installing 837001 Critical Update

ECHO Security Issue in Windows Could Allow Remote Take Over...

ECHO Please wait...

start /wait %systemdrive%\install\Hotfixes\Q837001.exe /quiet /O /N /norestart

ECHO.

ECHO.

ECHO Installing 837009 Patch

ECHO Cumulative Patch for Outlook Express...

ECHO Please wait...

start /wait %systemdrive%\install\hotfixes\q837009.exe /Q:A /R:N

ECHO.

ECHO.

ECHO Running Qchain...

start /wait %systemdrive%\install\Hotfixes\Qchain.exe

ECHO.

ECHO.

ECHO Cleaning-Up Directory Structure...

ECHO.

ECHO Windows 2000 will restart in 60 Seconds...

ECHO.

ECHO DO NOT END BATCH FILE!!

Sleep 60

ECHO.

wizmo reboot

EXIT

[Cleanup.cmd]

CLS

@echo off

ECHO.

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%\install

DEL /S /Q %.\Cleanup.cmd

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Note that "Wizmo" is a free app from www.grc.com, copies over in "System32" folder.

dennxyz

Posted

I tested the shutdown and delete itself section here's the test:

ECHO Restarting the PC
shutdown.exe -r -f -t 0

ECHO Deleting itself
del 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 /?).

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