Solved

URGENT!!! Batch Script

Posted on 2004-08-18
13
1,244 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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Robocopy - migrate user shares access denied 6 1,501
Just changed my 2000 Server DCs IP now what 3 396
Group Policy 9 558
Adapt windows 2003 server script to windows 2000 server 25 209
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…
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

910 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

23 Experts available now in Live!

Get 1:1 Help Now