Solved

URGENT!!! Batch Script

Posted on 2004-08-18
13
1,264 Views
Last Modified: 2012-05-05
I am trying to create a batch file that will run multiple installs from nested directories. My batch script looks like this:

.\setup.exe /s /w /v"iSX_SERIALNUMBER=1016-1414-8997-8997-2968-4069 TRANSFORMS=Acrostan.mst /qn
.\601\ac60bap1.exe -s -a "/p Ac60BaP1.msp REINSTALLMODE=omus REINSTALL=ALL /qn"
.\602\"adobe acrobat - reader 6.0.2 update.msi" /q/n


Any ideas or suggestions?
Bearhug9
0
Comment
Question by:bearhug9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 2
  • +1
13 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 11830294
Hi bearhug9,
Try preceding these lines with
Start /Wait .\setup.exe....
Start /Wait .\601\....
Start /Wait .\602\....
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 11830331
You could use the sleep exe between them also which can be downloaded from microsoft; also I would change directories to execute them it is a little extra code but if it uses items in the particular directory it might have trouble finding them if you run them from a different location.
0
 
LVL 17

Expert Comment

by:Eagle6990
ID: 11831617
You are missing the trailing " on the first line.  You only have one in that entire line


.\setup.exe /s /w /v iSX_SERIALNUMBER=1016-1414-8997-8997-2968-4069 TRANSFORMS=Acrostan.mst /qn
.\601\ac60bap1.exe -s -a /p Ac60BaP1.msp REINSTALLMODE=omus REINSTALL=ALL /qn
".\602\adobe acrobat - reader 6.0.2 update.msi" /q/n
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:bearhug9
ID: 11832152
I'm trying to run this batch as a package from the SMS Command line but it has trouble finding the directories... Please help...
0
 
LVL 17

Expert Comment

by:Eagle6990
ID: 11832273
Never used the SMS command line, but does it support the .\ at all?  You might need to put in the full share path for your clients to be able to access it if SMS is pushing the script to their local computer.

You also shouldn't need to put "" around the parameters, only on the full path and executable if it includes spaces.
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 11832422
Some things that look wierd:

.\setup.exe /s /w /v"iSX_SERIALNUMBER=1016-1414-8997-8997-2968-4069 TRANSFORMS=Acrostan.mst /qn
there is no end quote here, but do you even need quotes since iSX_SERIALNUMBER & TRANSFORMS are 2 different options?

.\601\ac60bap1.exe -s -a "/p Ac60BaP1.msp REINSTALLMODE=omus REINSTALL=ALL /qn"
usually if a exe uses a switch it is built to use a - or / not both and again multiple options REINSTALLMODE & REINSTALL shouldn't have quotes around them because it will usually pass as one argument.

.\602\"adobe acrobat - reader 6.0.2 update.msi" /q/n
Are you sure this is a valid msi, you might want to make it easier on yourself and rename it acrobat602.msi then you wouldn't need the quotes.
0
 

Author Comment

by:bearhug9
ID: 11832519
It seems to work if I run this batch file locally, but when I run this through SMS on the command line, it fails because it doesn't know which directory it's looking for. Is there a way to script this using environment variables so that it knows which directory it's looking at in SMS?
0
 
LVL 17

Accepted Solution

by:
Eagle6990 earned 500 total points
ID: 11832675
Are these executable files available on a network share anywhere?  I would set a variable in the beginning of  your script and then use that variable to point to where the files are located.

@echo off
setlocal
set PATHTOFILES=\\server\share

%PATHTOFIXES%\setup.exe /s /w /v"iSX_SERIALNUMBER=1016-1414-8997-8997-2968-4069 TRANSFORMS=Acrostan.mst /qn
%PATHTOFIXES%\601\ac60bap1.exe -s -a "/p Ac60BaP1.msp REINSTALLMODE=omus REINSTALL=ALL /qn"
%PATHTOFIXES%\602\"adobe acrobat - reader 6.0.2 update.msi" /q/n
0
 

Author Comment

by:bearhug9
ID: 11832921
ok,
    Would anyone know what the SMS distribution share evironment variable is, or where I can find it? We have 2 SMS distribution shares and I'd like to use a variable in the script to point to them..


Thanks for your prompt replies!!!! This site is awesome!!!!
0
 
LVL 17

Expert Comment

by:Eagle6990
ID: 11832955
You can check the local variables on a machine, be it your client or your server, by going to the command prompt and typing
set
0
 

Author Comment

by:bearhug9
ID: 11833451
I previously looked at the local machine and the Server environment variables, but it only has the SMS_Local_DIR=C:\WINNT.....

0
 
LVL 17

Expert Comment

by:Eagle6990
ID: 11833501
what shows up when you do
net share
0
 

Author Comment

by:bearhug9
ID: 11870791
Guys,
     Thanks for all the help!!! This site ROCKS!!!!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

705 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