Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

URGENT!!! Batch Script

Posted on 2004-08-18
13
Medium Priority
?
1,275 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

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…
Your business may be under attack from a silent enemy that is hard to detect. It works stealthily in the shadows to access and exploit your critical business information, sensitive confidential data and intellectual property, for commercial gain. T…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Screencast - Getting to Know the Pipeline

886 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