Solved

URGENT!!! Batch Script

Posted on 2004-08-18
13
1,240 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
 

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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

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…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now