a06lp Posted January 26, 2005 Share Posted January 26, 2005 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 More sharing options...
CHANDER Posted January 26, 2005 Share Posted January 26, 2005 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 More sharing options...
a06lp Posted January 26, 2005 Author Share Posted January 26, 2005 i know, that's why there are the "."s there, it should avoid this problem - it does in cmdlines.txt. I just never tested it with winnt.sif...can anyone else help? Link to comment Share on other sites More sharing options...
a06lp Posted January 26, 2005 Author Share Posted January 26, 2005 anyone ever attempt this? calling a file located on the CD from GuiRunOnce? (as opposed to it being copied over from "$oem$\$1\Install")? Link to comment Share on other sites More sharing options...
a06lp Posted January 26, 2005 Author Share Posted January 26, 2005 anyone? Link to comment Share on other sites More sharing options...
RyanVM Posted January 26, 2005 Share Posted January 26, 2005 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=%%istart /wait %CDROM%\Updates\apps\netfxsp1.exeObviously, the second line is a usage example. Link to comment Share on other sites More sharing options...
RogueSpear Posted January 27, 2005 Share Posted January 27, 2005 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 ExplicitDim fs, objService, objSoftware, Drives, Drive, strFiles, errReturnSet 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 More sharing options...
a06lp Posted January 27, 2005 Author Share Posted January 27, 2005 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 More sharing options...
ev0_05 Posted January 27, 2005 Share Posted January 27, 2005 so if i putin my RunOnceExfor %%i in (C: D: E: F: G: H: I: J:) do if exist %%i\win51ip.SP2 set CDROM=%%istart /wait %CDROM%\install\wpi\WPI.cmdAndcmd1[pn]=['%CDROM%\\Install\\Blah\\Blah.exe /S']would wpi install it from the cd? Link to comment Share on other sites More sharing options...
a06lp Posted January 27, 2005 Author Share Posted January 27, 2005 so it's not possible? Link to comment Share on other sites More sharing options...
a06lp Posted January 27, 2005 Author Share Posted January 27, 2005 so it's not possible? Link to comment Share on other sites More sharing options...
Alanoll Posted January 27, 2005 Share Posted January 27, 2005 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 More sharing options...
Cartoonite Posted January 27, 2005 Share Posted January 27, 2005 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\RunOnceExREG ADD %KEY% /V TITLE /D "Title For Window" /fREG ADD %KEY%\001 /VE /D "Name of step" /fREG ADD %KEY%\001 /V 1 /D "%CDROM%\WPI\WPI.cmd" /fThis 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 More sharing options...
EliasXP Posted February 1, 2005 Share Posted February 1, 2005 I don't think this is possible, you have to copy a batch file Link to comment Share on other sites More sharing options...
Rico.JohnnY Posted February 1, 2005 Share Posted February 1, 2005 you can use setx.exe which can be obtained from XPCD\support\tools\support.cab,place it in $OEM$\$$\system32Execute a batch file containing the following code @T12(from cmdline.txt)setx SOURCE -k HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\SourcePath -mthis will establish a system environment variable called "SOURCE" which stands for the CD drive you install XP fromuse[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 More sharing options...
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