Jump to content

RunOnceEX.cmd


Recommended Posts

Hi.

I seem to be having problems with the RunOnceEX.cmd not runnning on the first login.

When windows finnishes installing it will reboot and windows will load, but once loaded and logged in it does not start the RunOnceEx to start installing my applications. If i reboot windows and login again RunOnceEx will start and install my applications. I have the RunOnceEx.cmd in $OEM$/$1/install directory and it is called using WinNT.sif in the 386 directory using the following line.

[GuiRunOnce]

%systemdrive%\install\RunOnceEx.cmd

Any one have any idea what the problem might be?

Many Thanks

Worf

Link to comment
Share on other sites


You might want to read this again ;)

http://unattended.msfn.org/unattended.xp/view/web/31/

This is what you did :

[GuiRunOnce]
%systemdrive%\install\RunOnceEx.cmd

This is how it should be :

First of all, remove the [GuiRunOnce] entries in winnt.sif, as RunOnceEx can be used to replace [GuiRunOnce] completely. Although you can use both if needed for some reason, but they will both run at the same time, so use caution.

To start RunOnceEx on first logon, we will need to import the registry keys during GUI-mode of Windows Setup. We can do this by using cmdlines.txt which executes a series of commands during the T-12 minute stage of Windows XP Setup. Create a cmdlines.txt file in Notepad and paste in the following:

[COMMANDS]
"RunOnceEx.cmd"

Save this as cmdlines.txt inside the $OEM$ folder within your Windows Setup Source folder. If there currently isn't one created, create one. While we're on the subject, feel free to read about the

Edited by muiz
Link to comment
Share on other sites

I'm not sure there's a technical problem here. You're using the [GuiRunOnce] section to run your .cmd file, that enters your registry settings for doing the RunOnce installation. If what you are saying is correct (it takes a second reboot to get the apps to start installing), this is expected behavior. From the description of GuiRunOnce in the Windows 2000 Resource Kit:

The [GuiRunOnce]section of the answer file contains a list of commands that run the first time a user logs on to the computer after Setup runs.

So, after your setup finishes, your computer is logged on, the .cmd file is run (importing the registry settings in your runonceex.cmd file to configure RunOnceEx), and then the next time the machine is rebooted and logged on, these registry settings are read in and installation begins. This is how it is supposed to be working.

Perhaps try running your RunOnceEx.cmd file from [setupParams], so that it is imported BEFORE the first reboot, not AFTER.

Link to comment
Share on other sites

Hi here is a copy of my cmdlines.txt and RunOnceEx.cmd files eyeball.

Thankyou for you offer to help, and also to you all.

CmdLines.txt.

[COMMANDS]

"useraccounts.cmd"

"RunOnceEx.cmd"

RunOnceEx.cmd

cmdow @ /HID

@echo off

IF EXIST D:\CD.TXT SET CDROM=D:

IF EXIST E:\CD.TXT SET CDROM=E:

IF EXIST F:\CD.TXT SET CDROM=F:

IF EXIST G:\CD.TXT SET CDROM=G:

IF EXIST H:\CD.TXT SET CDROM=H:

IF EXIST I:\CD.TXT SET CDROM=I:

IF EXIST J:\CD.TXT SET CDROM=J:

IF EXIST K:\CD.TXT SET CDROM=K:

IF EXIST L:\CD.TXT SET CDROM=L:

IF EXIST M:\CD.TXT SET CDROM=M:

IF EXIST N:\CD.TXT SET CDROM=N:

IF EXIST O:\CD.TXT SET CDROM=O:

IF EXIST P:\CD.TXT SET CDROM=P:

IF EXIST Q:\CD.TXT SET CDROM=Q:

IF EXIST R:\CD.TXT SET CDROM=R:

IF EXIST S:\CD.TXT SET CDROM=S:

IF EXIST T:\CD.TXT SET CDROM=T:

IF EXIST U:\CD.TXT SET CDROM=U:

IF EXIST V:\CD.TXT SET CDROM=V:

IF EXIST W:\CD.TXT SET CDROM=W:

REG ADD %KEY% /V TITLE /D "Installing Applications And Other Files" /f

; User Information

; Installing Applications And Other Files.

REG ADD %KEY%\001 /VE /D "Over the next few minutes you will see automated installations"/f

REG ADD %KEY%\001 /VE /D "of various software applications, windows updates, and registry tweaks" /f

REG ADD %KEY%\001 /VE /D "being implemented. The computer will restart automatically" /f

REG ADD %KEY%\001 /VE /D "once the whole process has finished!" /f

REG ADD %KEY%\001 /VE /D " " /f

; Applications To Install

; WinZip 10

REG ADD %KEY%\005 /VE /D "WinZip 10" /f

REG ADD %KEY%\005 /V 1 /D "%CDROM%\Software\WinZip\SETUP.exe /autoinstall /noqp" /f

REG ADD %KEY%\005 /V 2 /D "REGEDIT /S %CDROM%\Software\WinZip\Reg.reg" /f

; WinRAR

REG ADD %KEY%\006 /VE /D "WinRAR" /f

REG ADD %KEY%\006 /V 1 /D "%CDROM%\Software\WinRAR\Wrar35.exe /s" /f

;Install Reg Tweaks

REG ADD %KEY%\080 /VE /D "Importing Registry Tweaks" /f

REG ADD %KEY%\080 /V 1 /D "REGEDIT /S %CDROM%\Regtweaks\Regtweaks.reg" /f

; Finding And Moveing My Documents

REG ADD %KEY%\100 /VE /D "Finding And Moving My Documents Folder"

For %%a in (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 %%a:\My Documents set MYDOC=%%a:\My Documents

REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders /v Personal /t REG_SZ /d "%MYDOCS%" /f

; Cleaning Up And Rebooting

REG ADD %KEY%\085 /VE /D "Cleaning Up And Rebooting" /f

REG ADD %KEY%\085 /V 1 /D "cleanup.cmd" /f

EXIT

Again thank you all

Regards

Worf

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