PerseExchange
asked on
How to substitute a %variable% for a drive letter or UNC name.
I am trying to copy my Office 2003 setup from the server to a DVD that can be sent out to users to self install Office. My officepro.ini file has an entry that points to
[ChainedInstall_1]
PATH=\\server\share\Apps\M icrosoft\O ffice\MSOf fice_2003\ FILES\Add- Ons\MSOffi ce.2007\Fi leFormatCo nverters.e xe
TASKTYPE=exe
CMDLINE=/quiet
[ChainedInstall_2]
PATH=\\server\share\Apps\M icrosoft\O ffice\MSOf fice_2003\ FILES\SVCP ACK\ohotfi x.exe
TASKTYPE=exe
What I want to do for these type entries that point to the \\server\share UNC name, is change it so that they point to a variable so it would not matter what the drive letter of the DVD is. I know the variable is surrounded by % sihns, I just do not know what to put in between for the variable. Any help on this would be appreciated.
[ChainedInstall_1]
PATH=\\server\share\Apps\M
TASKTYPE=exe
CMDLINE=/quiet
[ChainedInstall_2]
PATH=\\server\share\Apps\M
TASKTYPE=exe
What I want to do for these type entries that point to the \\server\share UNC name, is change it so that they point to a variable so it would not matter what the drive letter of the DVD is. I know the variable is surrounded by % sihns, I just do not know what to put in between for the variable. Any help on this would be appreciated.
Another Quick thing you can do is this.
@echo off
ECHO Try to found the CDROM-DRIVE
SET CDROM=A
IF EXIST D:\CDROM_IP.5 SET CDROM=D:
IF EXIST E:\CDROM_IP.5 SET CDROM=E:
IF EXIST F:\CDROM_IP.5 SET CDROM=F:
IF EXIST G:\CDROM_IP.5 SET CDROM=G:
IF EXIST H:\CDROM_IP.5 SET CDROM=H:
IF EXIST I:\CDROM_IP.5 SET CDROM=I:
IF EXIST J:\CDROM_IP.5 SET CDROM=J:
IF EXIST K:\CDROM_IP.5 SET CDROM=K:
IF EXIST L:\CDROM_IP.5 SET CDROM=L:
IF EXIST M:\CDROM_IP.5 SET CDROM=M:
IF EXIST N:\CDROM_IP.5 SET CDROM=N:
IF EXIST O:\CDROM_IP.5 SET CDROM=O:
IF EXIST P:\CDROM_IP.5 SET CDROM=P:
IF EXIST Q:\CDROM_IP.5 SET CDROM=Q:
IF EXIST R:\CDROM_IP.5 SET CDROM=R:
IF EXIST S:\CDROM_IP.5 SET CDROM=S:
IF EXIST T:\CDROM_IP.5 SET CDROM=T:
IF EXIST U:\CDROM_IP.5 SET CDROM=U:
IF EXIST V:\CDROM_IP.5 SET CDROM=V:
IF EXIST W:\CDROM_IP.5 SET CDROM=W:
IF EXIST X:\CDROM_IP.5 SET CDROM=X:
IF EXIST Y:\CDROM_IP.5 SET CDROM=Y:
IF EXIST Z:\CDROM_IP.5 SET CDROM=Z:
if %CDROM%==A GOTO :CD_ERR
ECHO Your CDROM-DRIVE is: %CDROM%
Sorry meant to add this to previous post
@echo off
ECHO Try to found the CDROM-DRIVE
SET CDROM=A
IF EXIST D:\CDROM_IP.5 SET CDROM=D:
IF EXIST E:\CDROM_IP.5 SET CDROM=E:
IF EXIST F:\CDROM_IP.5 SET CDROM=F:
IF EXIST G:\CDROM_IP.5 SET CDROM=G:
IF EXIST H:\CDROM_IP.5 SET CDROM=H:
IF EXIST I:\CDROM_IP.5 SET CDROM=I:
IF EXIST J:\CDROM_IP.5 SET CDROM=J:
IF EXIST K:\CDROM_IP.5 SET CDROM=K:
IF EXIST L:\CDROM_IP.5 SET CDROM=L:
IF EXIST M:\CDROM_IP.5 SET CDROM=M:
IF EXIST N:\CDROM_IP.5 SET CDROM=N:
IF EXIST O:\CDROM_IP.5 SET CDROM=O:
IF EXIST P:\CDROM_IP.5 SET CDROM=P:
IF EXIST Q:\CDROM_IP.5 SET CDROM=Q:
IF EXIST R:\CDROM_IP.5 SET CDROM=R:
IF EXIST S:\CDROM_IP.5 SET CDROM=S:
IF EXIST T:\CDROM_IP.5 SET CDROM=T:
IF EXIST U:\CDROM_IP.5 SET CDROM=U:
IF EXIST V:\CDROM_IP.5 SET CDROM=V:
IF EXIST W:\CDROM_IP.5 SET CDROM=W:
IF EXIST X:\CDROM_IP.5 SET CDROM=X:
IF EXIST Y:\CDROM_IP.5 SET CDROM=Y:
IF EXIST Z:\CDROM_IP.5 SET CDROM=Z:
if %CDROM%==A GOTO :CD_ERR
ECHO Your CDROM-DRIVE is: %CDROM%
Sorry meant to add this to previous post
in the above you would want to subsititute cdrom_ip.5 for a folder or file on the root of the DVD in question. This just checks all drive letter for that information, once it finds it, it creates the %CDROM% variable.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
matrixnz, thanks a million man. This helped out greatly, and is working like a champ.
If this is not what you are looking for please elaborate.