ToCsIcK Posted March 4, 2006 Share Posted March 4, 2006 (edited) Hey first post, im new to the forum but ive done a few unattended installations and i wanna share something i havnt seen around the forum and i thought was pretty useful.If you have a second HDD or second CD-Rom or even a USB flash drive with this code u can have applications that dont fit on the first cd on these and have them install from that. It'll look for start.bat on each drive and if it finds it it'll run it. This is useful if u are always changing the applications u want installed but dont wanna create a new installation CD each time, all u have to do is put the new applications on that drive and update the start.bat, no need to update and reburn the installation CD. @IF EXIST A:\start.bat set DRIVE=A:@IF EXIST D:\start.bat set DRIVE=D:@IF EXIST E:\start.bat set DRIVE=E:@IF EXIST F:\start.bat set DRIVE=F:@IF EXIST G:\start.bat set DRIVE=G:@IF EXIST H:\start.bat set DRIVE=H:@IF EXIST I:\start.bat set DRIVE=I:@IF EXIST J:\start.bat set DRIVE=J:@IF EXIST K:\start.bat set DRIVE=K:@IF EXIST L:\start.bat set DRIVE=L:@IF EXIST M:\start.bat set DRIVE=M:@IF EXIST N:\start.bat set DRIVE=N:@IF EXIST O:\start.bat set DRIVE=O:@IF EXIST P:\start.bat set DRIVE=P:@IF EXIST Q:\start.bat set DRIVE=Q:@IF EXIST R:\start.bat set DRIVE=R:@IF EXIST S:\start.bat set DRIVE=S:@IF EXIST T:\start.bat set DRIVE=T:@IF EXIST U:\start.bat set DRIVE=U:@IF EXIST V:\start.bat set DRIVE=V:@IF EXIST W:\start.bat set DRIVE=W:@IF EXIST X:\start.bat set DRIVE=X:@IF EXIST Y:\start.bat set DRIVE=Y:@IF EXIST Z:\start.bat set DRIVE=Z:@IF EXIST %DRIVE%\start.bat GOTO EXISTSECHO.ECHO Additional application installer not foundGOTO NOTEXISTS:EXISTSECHO Aditional application installer foundCALL %DRIVE%\start.bat:NOTEXISTSIts tested to work but if anyone finds sumthing rong please contributeHope this helps someone Edited March 4, 2006 by ToCsIcK Link to comment Share on other sites More sharing options...
gunsmokingman Posted March 4, 2006 Share Posted March 4, 2006 Here your code made a lttile smaller@Echo Off && CLS && Mode 75,5 && Color f3 && Title Extra App Installfor %%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\start.bat set DRIVE=%%iECHO. && ECHO Additional application installer not foundping -n 4 127.0.0.1>NulGOTO NOTEXISTSIF EXIST %DRIVE%\start.bat GOTO EXISTS:EXISTSECHO. && ECHO Aditional application installer foundping -n 4 127.0.0.1>NulCALL %DRIVE%\start.bat:NOTEXISTSExitThe VBS WayDim Act, Cmd1, Drv, Fso, strDrv : Cmd1 = "start.bat" Set Act = CreateObject("Wscript.Shell") Set Fso = CreateObject("Scripting.FileSystemObject") Set Drv = Fso.Drives For Each strDrv In Drv If strDrv.IsReady = True Then If Fso.FileExists(strDrv & "\" & Cmd1) Then Act.Popup "Confirm Found At This Location : " & strDrv & "\" & Cmd1, 7, "Confirm", 0 + 48 Act.Run(strDrv & "\" & Cmd1),1,True Exit For Else Act.Popup "Cannot Find This File On : " & strDrv & "\" & Cmd1, 7, "Missing", 0 + 48 End If End If Next Link to comment Share on other sites More sharing options...
ToCsIcK Posted March 4, 2006 Author Share Posted March 4, 2006 (edited) O thnx, i was just trying to do that but i couldnt get it to work.Edit: Just relized that once u call the other batch file you wont be able to install with that script beacause it wont know what drive it is (I explained that badly :S) anyway found a way to fix itFOR %%i 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 %%i\start.bat SET DRIVE=%%i@IF EXIST %DRIVE%\start.bat GOTO EXISTSECHO.ECHO Additional Application Installer not foundGOTO NOTEXISTS:EXISTSECHO Aditional Application Installer foundCALL %DRIVE%\start.bat %DRIVE%:NOTEXISTSthen in start.bat on the drive you put, for example@echo offECHO.ECHO Installing ProgramECHO Please wait...start /wait %1\applications\program\setup.exe -s Edited March 4, 2006 by ToCsIcK Link to comment Share on other sites More sharing options...
gunsmokingman Posted March 4, 2006 Share Posted March 4, 2006 This will work also@echo offSet CD=%CD%ECHO.ECHO Installing ProgramECHO Please wait...start /wait %CD%\applications\program\setup.exe -s Link to comment Share on other sites More sharing options...
darksimoon Posted March 10, 2006 Share Posted March 10, 2006 @ToCsIcKhey friend its a nice idea. thanks a lot. but i want to add something more if it works;you say if we have a second CD-Rom. but for instance i have only one CD-ROM. cant i delay start.cmd to work for a few time so that i can change the software CD ? or cant we add "try again" option ?what do you think about it ? and how ? Link to comment Share on other sites More sharing options...
Alanoll Posted March 11, 2006 Share Posted March 11, 2006 no one reads anymore....http://www.msfn.org/board/index.php?showtopic=41821http://www.msfn.org/board/index.php?showtopic=8381Those are the first two that come to mind. One is a sticky post at the top of the forum, and another can be found following the links in the ANNOUNCEMENT post at the top of the forum.(Not to burst your bubble or anything, just thought i'd point out it's been mentioned before......LONG ago.....I've been here awhile ) 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