compster Posted March 26, 2005 Share Posted March 26, 2005 I have put together an unattended cd with no problem, but I find that I am always updating apps with new versions.I would rather create a generic xpcd that directs start.cmd or runonceex.cmd to install my various programs from my d:\install files directory.This way I can update the apps without having to create a new cd and also install more programs than would fit on a cd in the $OEM$ folder.I haven't been able to figure this out. Link to comment Share on other sites More sharing options...
erik_demon Posted March 26, 2005 Share Posted March 26, 2005 Check out this post Link to comment Share on other sites More sharing options...
compster Posted March 26, 2005 Author Share Posted March 26, 2005 I did read that post, but I'm not trying to install Windows from another hard drive, I just want RunOnceEx.cmd or Start.cmd to install programs from a hard drive after windows has been installed.Normally, the programs are copied from the cd OEM folders and installed from C:\apps. I want to direct the install to be done from D:\install files (for example). Link to comment Share on other sites More sharing options...
erik_demon Posted March 26, 2005 Share Posted March 26, 2005 Ow, sorry I misunderstood your question This can be done very easily.You can do this in two ways:Method 1You can use the drive path of which you want to install from.Example, you want to install from another harddrive ( D:\ ) and you have your applications under d:\install_files.You can now use this line under RunonceEX:REG ADD %KEY%\010 /V 01 /D "D:\install_files\peace_of_software\application /Switch" /fIn this way $OEM$\$1 folder isn't neccesary anymore.Method 2Ofcourse you want to use direct paths as less as possible. So now we are going to change D:\ into %harddrive%Add this line to the top of your RunonceEX:SET tagfile=\install_files\install_from_harddrive.txtFOR %%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:%tagfile%" set harddrive=%%i:Now, create a textfile (you can leave the file empty) and name it install_from_harddrive.txtBe sure to put it in the right folder like this:D:\install_files\install_from_harddrive.txt.D:\ can ofcourse be something else. When this batch is loaded, it will check the locations C:\install_files to Z:\install_files to find if the file install_from_harddrive.txt exists. If so, this drive can be called with %harddrive%.Now you can use code like this in your runonceex:REG ADD %KEY%\010 /V 01 /D "%harddrive%\install_files\peace_of_software\application /Switch" /fI hope this helpErik Link to comment Share on other sites More sharing options...
compster Posted March 26, 2005 Author Share Posted March 26, 2005 Thanks for your help. That's what I'm looking for. I think my problem has been the spaces in the path.Why is that not a problem for an install from OEM folder C:\apps, but it is when you direct it to D:?For example, I had no problem with my Batch.cmd that I loaded from:[GuiRunOnce]%systemdrive%\apps\batch.cmdCan I have winnt.sif directed to D:\install\batch.cmd or is it better to stick with runonceex.cmd?ECHO.ECHO Installing K-Lite Codec V2.34 ...ECHO Please wait...start /wait %systemdrive%\apps\K-Lite Codec\klcodec234f.exe /silentBut, to install it from D:\install\Batch.cmd I had to change it to:ECHO.ECHO Installing K-Lite Codec V2.34 ...ECHO Please wait...start /wait %systemdrive%\apps\K-Lite_Codec\klcodec234f.exe /silentwithout the space in the folder name. Link to comment Share on other sites More sharing options...
gunsmokingman Posted March 26, 2005 Share Posted March 26, 2005 Here Is Another Way With A Error ControlBlue Is The Folder adjust to your needsecho off && cls && Mode 65,5 && Color 5e && Title My Installset P4=Ping -n 4 127.0.0.1SET tagfile=\SomeFolderFOR %%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:%tagfile%" set harddrive=%%i:\ if exist "%harddrive%" goto Confirmif not exist "%harddrive%" goto Missing:Confirmecho. && echo Your Install Location -^> %harddrive%%P4%>nulgoto quit:Missingecho. && Echo The Location Not Present && %P4%>nulgoto quit:quitGoto EOFexit Link to comment Share on other sites More sharing options...
durex Posted March 26, 2005 Share Posted March 26, 2005 Thanks for your help. That's what I'm looking for. I think my problem has been the spaces in the path.Why is that not a problem for an install from OEM folder C:\apps, but it is when you direct it to D:?For example, I had no problem with my Batch.cmd that I loaded from:[GuiRunOnce]%systemdrive%\apps\batch.cmdCan I have winnt.sif directed to D:\install\batch.cmd or is it better to stick with runonceex.cmd?ECHO.ECHO Installing K-Lite Codec V2.34 ...ECHO Please wait...start /wait %systemdrive%\apps\K-Lite Codec\klcodec234f.exe /silentBut, to install it from D:\install\Batch.cmd I had to change it to:ECHO.ECHO Installing K-Lite Codec V2.34 ...ECHO Please wait...start /wait %systemdrive%\apps\K-Lite_Codec\klcodec234f.exe /silentwithout the space in the folder name.<{POST_SNAPBACK}>The problem isnt the location.. the problem is that in your original example, you have spaces in your paths... you need to use quotes. i.e:start /wait "%systemdrive%\apps\K-Lite Codec\klcodec234f.exe" /silent Link to comment Share on other sites More sharing options...
erik_demon Posted March 27, 2005 Share Posted March 27, 2005 @gunsmokingmanThat seems like a great additionCan you explain the following to me?set P4=Ping -n 4 127.0.0.1And%P4%>nulWhat is the function of ping here? Link to comment Share on other sites More sharing options...
durex Posted March 27, 2005 Share Posted March 27, 2005 Ping -n 4 127.0.0.1>nul will ping that ip address (your local machines 'loopback' address) for 4 seconds (-n 4).This is just a common way of 'stalling' or 'pausing' your batch file for a determined about of time.The syntax he used just cleaned it up a bit... he created a variable called 'P4' and set it to 'Ping -n 4 127.0.0.1'. This way if he had to use it multple times through out the script he can simply reference the variable instead of typing out the entire line every time. Link to comment Share on other sites More sharing options...
gunsmokingman Posted March 27, 2005 Share Posted March 27, 2005 Ping -n 4 127.0.0.1>nul will ping that ip address (your local machines 'loopback' address) for 4 seconds (-n 4).This is just a common way of 'stalling' or 'pausing' your batch file for a determined about of time.The syntax he used just cleaned it up a bit... he created a variable called 'P4' and set it to 'Ping -n 4 127.0.0.1'. This way if he had to use it multple times through out the script he can simply reference the variable instead of typing out the entire line every time.<{POST_SNAPBACK}>You Beat Me To It Thanks For Replying Link to comment Share on other sites More sharing options...
erik_demon Posted March 27, 2005 Share Posted March 27, 2005 @durexOkay I see, thanks So basicly I could change this into a sleep of 4 seconds. Then again, I won't change it, this looks better 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