Solved

URGENT!!! Batch Script

Posted on 2004-08-18
13
1,255 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
  • 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

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 eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Server Hard Drive Expansion 2 161
kerberos errors 7 554
Slow access to network shares - Win 2000 accessing Win 8 Share 5 145
Closing cmd window after script execution 4 419
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…
No single Antivirus application (despite claims by manufacturers) will catch or protect you from all Virus / Malware or Spyware threats. That doesn't stop you from further protecting yourself however - and this article is to show you how.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

685 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