Steffen Posted October 27, 2005 Share Posted October 27, 2005 Hello,I use the method in in winnt.sif with [GuiRunOnce]"%cdrom%\Progs\start.cmd"But I think the varible doesnt work on that time.. Can somebody help me !?!? Link to comment Share on other sites More sharing options...
cluberti Posted October 27, 2005 Share Posted October 27, 2005 It would be better to place that file in your $OEM$\$1\TEMP folder (or whatever $1\<*> folder you choose) and run it from there via %systemdrive%\TEMP\start.cmd. %CDROM% is not a valid variable in Windows unless you set it. Link to comment Share on other sites More sharing options...
Steffen Posted October 27, 2005 Author Share Posted October 27, 2005 I dont use the $OEM methode because it doesnt fit with s-ata drivers during the beginning on the setup. When you have to press F6..It will be interesting how to set the %CDROM% variable on !! Link to comment Share on other sites More sharing options...
gunsmokingman Posted October 27, 2005 Share Posted October 27, 2005 This might work you have to start this vbs file from GuiRunOnceSave As SetCd_Passvarible_ToCmd.vbsDim Act, CD, Fso, strCd '''' VARIBLES FOR THE SCRIPT Set Act = CreateObject("Wscript.Shell") '''' VARIBLE AS A OBJECT Set Fso = CreateObject("Scripting.FileSystemObject") Set CD = Fso.Drives For Each strCd In CD If strCd.DriveType = 4 Then '''' CHECKS FOR THE CD OR DVD DRIVE If Fso.FileExists(strCd & "\win51") Then '''' THIS CONFIRM IT CORRECT CD Act.Popup "This Is A XP CD",5,"Confirm XP CD", 0 + 32 SD = Act.ExpandEnvironmentStrings("%systemdrive%") strFileName = (SD & "\SetCD_Var.cmd") strFileName = Fso.GetAbsolutePathName(strFileName) Set ts = Fso.OpenTextFile(strFileName, 2, True) ts.WriteLine "echo off" ts.WriteLine "set CDROM=" & strCd ts.Close Else Act.Popup "This Is Not The Correct CD",5,"Incorrect CD", 0 + 32 End If End If NextThen you call the cmd that is made with this oneSave As GetCdVar_Call.cmdecho offcall %systemdrive%\SetCD_Var.cmdecho %CDROM%pauseWhat these 2 scripts do is the VBS set the CD letter and then writes the varible to%systemdrive%\SetCD_Var.cmd then it is called by GetCdVar_Call.cmd and theCD drive letter is passed to this cmd.Hope this is helpfull. Link to comment Share on other sites More sharing options...
Oleg_II Posted October 27, 2005 Share Posted October 27, 2005 The simplest way as cluberti says is placing it with OEM folders.If you don't use OEM folders you can place your CMD with this variable in SVCPACK.INF.@echo offREM find cdrom and set variable CDDRIVEfor %%i in (C 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 %%i:\cdrom_nt.5 set CDDRIVE=%%i:set WINPATH=%CDDRIVE%\REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v "CDDRIVE" /t REG_EXPAND_SZ /d ^%WINPATH%^ /fstart /wait %CDDRIVE%\defence\antivirus.exeThis should give you an example of using for installation ANTIVIRUS.EXE program that is in folder DEFENCE on installation CDROM. Link to comment Share on other sites More sharing options...
Steffen Posted October 27, 2005 Author Share Posted October 27, 2005 (edited) This might work you have to start this vbs file from GuiRunOnceSave As SetCd_Passvarible_ToCmd.vbsI dont understand you... Where do I have to put that files on my cd ?? I dont use the $OEM methode so I cant set the files on the HD..I want to copy the files with a *.cmd file but first I have to set the variable onThe simplest way as cluberti says is placing it with OEM folders.If you don't use OEM folders you can place your CMD with this variable in SVCPACK.INF.@echo offREM find cdrom and set variable CDDRIVEfor %%i in (C 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 %%i:\cdrom_nt.5 set CDDRIVE=%%i:set WINPATH=%CDDRIVE%\REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v "CDDRIVE" /t REG_EXPAND_SZ /d ^%WINPATH%^ /fstart /wait %CDDRIVE%\defence\antivirus.exeThis should give you an example of using for installation ANTIVIRUS.EXE program that is in folder DEFENCE on installation CDROM.How can I open SVCPACK.INF ???I use a notepad but it dont work ? svcpack.in_ is the file you mean ??PS: I have a cd with SP2 I am reading on http://unattended.msfn.org/global/examples.htm and there is standing that the SVPACK file online exist without SP2 ???" » svcpack.inf (was used for Windows XP SP1) " Edited October 27, 2005 by Steffen Link to comment Share on other sites More sharing options...
Oleg_II Posted October 27, 2005 Share Posted October 27, 2005 (edited) Ok. So you should make some search and reading then svcpack.in_ is an archived version of svcpack.inf. Before editing this file with Notepad you should expand it.I would recommend you to go and grab a really great tool here _http://www.msfn.org/board/index.php?showtopic=27469&hl= This tool will give you the ability to open and pack the files from the source distributive. But please! Be careful with your experimenting with source files! Edited October 27, 2005 by Oleg_II Link to comment Share on other sites More sharing options...
Yzöwl Posted October 27, 2005 Share Posted October 27, 2005 You could try adding the following under [GuiUnattended] in your winnt.sifDetachedProgram = cmd.exe Arguments = "/C FOR /F %? IN ('MOUNTVOL ^| FIND ":\"') DO IF EXIST %?WIN51 START %?Progs\start.cmd"It should be two lines only!All you would need to do from start.cmd is reference your CD-ROM drive as %~d0 or CD-ROM\Progs\ as %~dp0 Link to comment Share on other sites More sharing options...
Oleg_II Posted October 27, 2005 Share Posted October 27, 2005 Yzöwl Great! Have to try it. Link to comment Share on other sites More sharing options...
Yzöwl Posted October 27, 2005 Share Posted October 27, 2005 I must add first, this is only a top of the head idea, if it doesn't work, you could always try replacing the Arguments string toArguments = "/C FOR /F %? IN ('C 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 %?:\WIN51 START %?:\Progs\start.cmd"Another less likely possibility in case of failure is to treat it as a batch and change all instances of %? to %%? Link to comment Share on other sites More sharing options...
Steffen Posted October 28, 2005 Author Share Posted October 28, 2005 I must add first, this is only a top of the head idea, if it doesn't work, you could always try replacing the Arguments string toArguments = "/C FOR /F %? IN ('C 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 %?:\WIN51 START %?:\Progs\start.cmd"Another less likely possibility in case of failure is to treat it as a batch and change all instances of %? to %%?This is standing in my winnt.sif[GuiRunOnce] Arguments = "/C FOR /F %? IN ('C 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 %?:\WIN51 START %?:Install\RunOnceEx.cmd"But i get an error after the installation is finished !!!!!Windows cant find the file /C Check if you have good spell it etc.........Got you a solution Link to comment Share on other sites More sharing options...
gunsmokingman Posted October 28, 2005 Share Posted October 28, 2005 Have you tried it this way, because he stats to treat it as a batch Another less likely possibility in case of failure is to treat it as a batch and change all instances of %? to %%?The way he say to try it if it failsArguments = "/C FOR /F %%? IN ('C 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 %%?:\WIN51 START %%?:Install\RunOnceEx.cmd" Link to comment Share on other sites More sharing options...
Steffen Posted October 28, 2005 Author Share Posted October 28, 2005 the double %% doesnt work Link to comment Share on other sites More sharing options...
Yzöwl Posted November 9, 2005 Share Posted November 9, 2005 The following two lines work fine for me!DetachedProgram = CMD.EXE Arguments = "/Q /C FOR /F %? IN ('%SYSTEMROOT%\SYSTEM32\MOUNTVOL.EXE^|FINDSTR :\') DO IF EXIST %?WIN51 START %?SUPPORT\TOOLS\XTRAS\renuser.exe Administrator root" Link to comment Share on other sites More sharing options...
timothysa Posted September 16, 2007 Share Posted September 16, 2007 The following two lines work fine for me!DetachedProgram = CMD.EXE Arguments = "/Q /C FOR /F %? IN ('%SYSTEMROOT%\SYSTEM32\MOUNTVOL.EXE^|FINDSTR :\') DO IF EXIST %?WIN51 START %?SUPPORT\TOOLS\XTRAS\renuser.exe Administrator root" Works Like a Charm ThanksI want to retain the Repair Installation in text mode so [unattended] and OemPreinstall is out of the question to copy SFX to %systemdrive%During GUI Setup I wanted to extract a password protected SFX at roughly the same time as Product Key, User, Computer Name etc(T-39 to T-33).Then bugger off and let my RunonceEx Install Reboot etc. No stupid questions to halt the install. Job DoneI can finally run my sfx off the CD Rom from DetachedprogramThanks 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