Jump to content

[GuiRunOnce] ... from CD?


Recommended Posts

Is it possible to run a cmd file from winnt.sif's [GuiRunOnce] thats on CD?

I know cmdlines.txt can run it in such a way, for example (working code):

[COMMANDS]
"REGEDIT /S ..\Tweaks\RegTweaks.reg"
"..\WPI\WPI.cmd"

so my Q is: Can I use this method for [GuiRunOnce]? I want to run the WPI.cmd file (which is in the WPI folder, which is in the Root of the CD, same level as the i386 folder), without copying it to HDD.

Link to comment
Share on other sites


As long as you specify the proper path...the problem with that is on different computer the cd has a different letter assignment...so you'd have to run a bit of code that would find your cd and save the letter a variable..then you can just use the variable as the path of the cd

$cd$:\wpi.cmd

Link to comment
Share on other sites

I always run my programs from the CD that are called by my GuiRunOnce batch file. You'd do something like this:

for %%i in (C: D: E: F: G: H: I: J:) do if exist %%i\win51ip.SP2 set CDROM=%%i
start /wait %CDROM%\Updates\apps\netfxsp1.exe

Obviously, the second line is a usage example.

Link to comment
Share on other sites

I've always used RunOnceEx to run programs from the CD/DVD. I use VBscipt instead of batch, but it's essentially the same process. Determine the drive letter and away you go. What I do is actually put a VBscript in the ROE entry and that script installs software from the media.

Option Explicit
Dim fs, objService, objSoftware, Drives, Drive, strFiles, errReturn
Set fs = CreateObject("Scripting.FileSystemObject")
Set objService = GetObject("winmgmts:")
Set objSoftware = objService.Get("Win32_Product")
Drives = Array("C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", _
"R", "S", "T", "U", "V", "W", "X", "Y", "Z")
For Each Drive In Drives
If fs.FileExists(Drive & ":\WIN51") Then strFiles = Drive & ":\EXTRAS\"
Next

'**********************************************************************
'** Run Tasks                                                        **
'**********************************************************************
errReturn = objSoftware.Install(strFiles & "\Adobe Reader 7.0.msi", , True)
errReturn = objSoftware.Install(strFiles & "\Camtasia Studio.msi", , True)
errReturn = objSoftware.Install(strFiles & "\FFDShow.msi", , True)
errReturn = objSoftware.Install(strFiles & "\J2RE5.0_1.msi", , True)

Link to comment
Share on other sites

nono, you both misunderstood me.

i know a batch file can determine a CDROM variable - but then i'd have to put a cmd file in $OEM$\$1 . I am trying to NOT copy ANYTHING to the harddrive (even the tiny cmd file).

so is there any way to get that INITIAL cmd file to run FROM the cd? maybe using an approach similar to what i post in my first post?

Link to comment
Share on other sites

so if i put

in my RunOnceEx

for %%i in (C: D: E: F: G: H: I: J:) do if exist %%i\win51ip.SP2 set CDROM=%%i

start /wait %CDROM%\install\wpi\WPI.cmd

And

cmd1[pn]=['%CDROM%\\Install\\Blah\\Blah.exe /S']

would wpi install it from the cd?

Link to comment
Share on other sites

wait for people to reply. You failed ot wait even 24 hours.

..\ does NOT work simply because GUIRunOnce is not executed in the $OEM$ directory. The current directory is on the HDD i believe. So it DOES NOT WORK.

It works in CMDLINES.TXT simply because CMDLINES.TXT has a current directory of $OEM$.

I've warned you before about waiting for people to reply...

Link to comment
Share on other sites

As far as I know it is not possible to do this with [GuiRunOnce], a06lp. However, you could use a script executed from cmdlines.txt. This is essentially what people use RunOnceEx.cmd to do.

Try running a batch file from there with code similar to:

for %%i in (C D E F G H I J K L M N O P Q R S T L U V W X Y Z) do if exist %%i\win51ip.SP2 set CDROM=%%i:

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V TITLE /D "Title For Window" /f

REG ADD %KEY%\001 /VE /D "Name of step" /f
REG ADD %KEY%\001 /V 1 /D "%CDROM%\WPI\WPI.cmd" /f

This will be run the first time a user logs in to Windows after the install has been completed, exactly the same time as a program called from [GuiRunOnce]. The only real difference is that there will be a dialogue box created that displays each successive program as it is run.

And do try to be a little more patient. Even one full day is not all that long to wait for an answer...

Link to comment
Share on other sites

you can use setx.exe which can be obtained from XPCD\support\tools\support.cab,place it in $OEM$\$$\system32

Execute a batch file containing the following code @T12(from cmdline.txt)

setx SOURCE -k HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\SourcePath -m

this will establish a system environment variable called "SOURCE" which stands for the CD drive you install XP from

use

[RuiRunOnce]
 %SOURCE%install.cmd
  %SOURCE%something
  ...................

to perform your job

Note the path does not contain a backlash "\"

hope this helps a bit

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