bearhug9
asked on
URGENT!!! Batch Script
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-1 414-8997-8 997-2968-4 069 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
.\setup.exe /s /w /v"iSX_SERIALNUMBER=1016-1
.\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
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.
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
.\setup.exe /s /w /v iSX_SERIALNUMBER=1016-1414
.\601\ac60bap1.exe -s -a /p Ac60BaP1.msp REINSTALLMODE=omus REINSTALL=ALL /qn
".\602\adobe acrobat - reader 6.0.2 update.msi" /q/n
ASKER
I'm trying to run this batch as a package from the SMS Command line but it has trouble finding the directories... Please help...
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.
You also shouldn't need to put "" around the parameters, only on the full path and executable if it includes spaces.
Some things that look wierd:
.\setup.exe /s /w /v"iSX_SERIALNUMBER=1016-1 414-8997-8 997-2968-4 069 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.
.\setup.exe /s /w /v"iSX_SERIALNUMBER=1016-1
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.
ASKER
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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!!!!
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!!!!
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
set
ASKER
I previously looked at the local machine and the Server environment variables, but it only has the SMS_Local_DIR=C:\WINNT.... .
what shows up when you do
net share
net share
ASKER
Guys,
Thanks for all the help!!! This site ROCKS!!!!
Thanks for all the help!!! This site ROCKS!!!!
Try preceding these lines with
Start /Wait .\setup.exe....
Start /Wait .\601\....
Start /Wait .\602\....