Jump to content

Aditional application cd


Recommended Posts

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

@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 EXISTS
ECHO.
ECHO Additional application installer not found
GOTO NOTEXISTS
:EXISTS
ECHO Aditional application installer found
CALL %DRIVE%\start.bat
:NOTEXISTS

Its tested to work but if anyone finds sumthing rong please contribute

Hope this helps someone

Edited by ToCsIcK
Link to comment
Share on other sites


Here your code made a lttile smaller

@Echo Off && CLS && Mode 75,5 && Color f3 && Title Extra App Install
for %%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=%%i

ECHO. && ECHO Additional application installer not found
ping -n 4 127.0.0.1>Nul
GOTO NOTEXISTS

IF EXIST %DRIVE%\start.bat GOTO EXISTS
:EXISTS
ECHO. && ECHO Aditional application installer found
ping -n 4 127.0.0.1>Nul
CALL %DRIVE%\start.bat
:NOTEXISTS
Exit

The VBS Way

Dim 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

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 it

FOR %%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 EXISTS
ECHO.
ECHO Additional Application Installer not found
GOTO NOTEXISTS
:EXISTS
ECHO Aditional Application Installer found
CALL %DRIVE%\start.bat %DRIVE%
:NOTEXISTS

then in start.bat on the drive you put, for example

@echo off
ECHO.
ECHO Installing Program
ECHO Please wait...
start /wait %1\applications\program\setup.exe -s

Edited by ToCsIcK
Link to comment
Share on other sites

@ToCsIcK

hey 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

no one reads anymore....

http://www.msfn.org/board/index.php?showtopic=41821

http://www.msfn.org/board/index.php?showtopic=8381

Those 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 :P )

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