[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to substitute a %variable% for a drive letter or UNC name.

Posted on 2007-07-31
5
Medium Priority
?
247 Views
Last Modified: 2008-01-09
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\Microsoft\Office\MSOffice_2003\FILES\Add-Ons\MSOffice.2007\FileFormatConverters.exe
TASKTYPE=exe
CMDLINE=/quiet

[ChainedInstall_2]
PATH=\\server\share\Apps\Microsoft\Office\MSOffice_2003\FILES\SVCPACK\ohotfix.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.
0
Comment
Question by:PerseExchange
  • 3
5 Comments
 
LVL 1

Expert Comment

by:Perkentha1
ID: 19603649
%cdrom% is the default variable for the systems first cd drive letter.

If this is not what you are looking for please elaborate.
0
 
LVL 1

Expert Comment

by:Perkentha1
ID: 19603715
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
0
 
LVL 1

Expert Comment

by:Perkentha1
ID: 19603849
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.
0
 
LVL 29

Accepted Solution

by:
matrixnz earned 1000 total points
ID: 19604743
Hi PerseExchange

You can use relative paths i.e. (the following should work, if not change PATH=\FILES\... to PATH=FILES\...)

Cheers

[ChainedInstall_1]
PATH=\FILES\Add-Ons\MSOffice.2007\FileFormatConverters.exe
TASKTYPE=exe
CMDLINE=/quiet

[ChainedInstall_2]
PATH=\FILES\SVCPACK\ohotfix.exe
TASKTYPE=exe
0
 

Author Comment

by:PerseExchange
ID: 19609088
matrixnz, thanks a million man. This helped out greatly, and is working like a champ.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
I came across an unsolved Outlook issue and here is my solution.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question