Run Script Problem

jefff's picture

I now have a problem where the 'Run Script' has a character limitation. The script determines what kind of computer it is and downloads the correct drivers and copies the correct sysprep folder.







The script works fine except that I can't add any more computers to the script. Here is what I have in the script.











EXAMPLE







if "%#!computer@prod_name%" =="optiplex 745" goto O745



if "%#!computer@prod_name%" =="latitude d430" goto D430



if "%#!computer@prod_name%" =="optiplex gx620" goto O620



if "%#!computer@prod_name%" =="optiplex gx280" goto O280



if "%#!computer@prod_name%" =="latitude d620" goto D620



if "%#!computer@prod_name%" =="latitude d630" goto d630



if "%#!computer@prod_name%" =="latitude d820" goto D820



if "%#!computer@prod_name%" =="latitude d810" goto D810



if "%#!computer@prod_name%" =="latitude d610" goto D610



if "%#!computer@prod_name%" =="latitude e6400" goto E6400



if "%#!computer@prod_name%" =="latitude e6500" goto E6500



if "%#!computer@prod_name%" =="latitude e4300" goto E4300



if "%#!computer@prod_name%" =="optiplex gx760" goto O760







goto Exit







745



firmwin -recurse copy .\drivers\O745 prod:\drivers



rem replacetokens .\drivers\O745\sysprep.inf .\temp\o745\%ID%.inf



firmwin -recurse copy .\temp\o745\%ID%.inf PROD:sysprep\sysprep.inf



goto Exit



430



firmwin -recurse copy .\drivers\D430 prod:\drivers



rem replacetokens .\drivers\D430\sysprep.inf .\temp\d430\%ID%.inf



firmwin -recurse copy .\temp\d430\%ID%.inf PROD:sysprep\sysprep.inf



goto Exit







etc.







I copied the script into a batch file but the rem replacetokens does not work properly. I get an error message saying "The file could not be found". I spoke with Altiris and they think it is a bug.







Does anybody have suggestions?

bhawver's picture

If by character limitation, you are talking about the size of the script, you are better off pointing the "Run Script" to a file in the express share folder structure.

jharings's picture

I'm not sure how they came to the determination that is was a bug. If you remove the last computer type the issue doesn't return? I see you have listed firmwin, does that mean you are using WinPE?

Jim Harings
Technical Solutions Consultant
Xcend Group
http://xcendgroup.com

jefff's picture

Hi jharings



According to Altiris there is a character limitation in the 'Run Script'. Right now I'm trying to figure out another way to add more computers to the script. Copying the script into a batch file under the express share does not work properly using the 'REM Replacetokens'.



I am using WinPe

bhawver's picture

Jeff, see my earlier post. That is what I have had to do to get past the same problem. Just make sure the file is saved as a BAT or CMD file for WinPE. Instead of "Run this script", select "run the script from file" and point it to your BAT or CMD file.

bhawver's picture

Also, be sure your slashes are the correct ones (/ vs. \).

jefff's picture

Are you using REM Replacetokens in your batch file?

bhawver's picture

I don't use DOS or WinPE (too slow either during boot process or imaging process), have found that Linux is my preferred way of doing this. I'd be more than happy to share this script with you if you would like. I haven't had to really use the tokens feature very much as the script seems to handle everything that I need. As a default, we have the machines renamed after imaging to the service tag (serial number) and the technician will then rename it to the appropriate name afterwards.

jefff's picture

If you don't mind I would like to take a look at the script

bhawver's picture

It should be attached in TXT format. linuxhiiscript.txt is my linux script. hii2script.txt is my old DOS script.

Timanator's picture

Was there ever a solution for

Was there ever a solution for this issue?

Timanator's picture

Tagged

Tagged

bhawver's picture

Increased Problems

The more new equipment I add to my scripts, I am seeing this more and more.  The way I worked around it was to shorten the scripts by using conditions.  So now, instead of having every possible piece of equipment in one script, I have broken down the full HII script into conditioned jobs.

Unfortunately, this means more administration if I ever need to change my imaging process, I now have to modify each of the conditioned jobs.