Alright I have been struggling like crazy to get tokens to work correctly for my hardware independent image. :banghead: I have the feeling I am simply missing something very easy here. Running DS 6.8, booting into a windows pe pre-boot environment. I am trying to use this script (I condensed it): echo Hardware Model number is %#!computer@model_num% if "%#!computer@model_num%" =="0G5611" goto GX280 REM If we didn't find a match, just exit goto Exit :GX280 firm -recurse copy .\drivers\GX280 prod:\drivers goto Exit :Exit exit It is not working however. echo Hardware Model number is %#!computer@model_num% returns %#!computer@model_num%. I have already spent a few days pouring over this site, google, and any documentation from altiris I can find but in everyone's examples %#!computer@model_num% just works. What am I doing wrong?
Here is a snippet of what we use at my work. echo %#!computer@prod_name% >> .\Models\%ID%.txt for /f "tokens=1-5" %%A in (.\Models\%ID%.txt) do (Set Model=%%C) If %Model% == dc7100 goto dc7100 If %Model% == nc2400(#ABA) goto nc2400 If %Model% == nc6400 goto nc6400 If %Model% == dc7600 goto dc7600 If %Model% == nc6220 goto nc6220 If %Model% == dc7700p goto dc7700p If %Model% == nc6220 goto nc6220 If %Model% == dc7700 goto dc7700 Hope that helps.
echo %#!computer@prod_name% >> .\Models\%ID%.txt I tried: echo %#!computer@prod_name% >> G:\test.txt Created test.txt with %#!computer@prod_name% inside of it.
Heh, alright I figured it out. :doh:Just make sure you are running the script through altiris and it will substitute the right information in for the token you are using. Going to the command line and running it when in the pre-boot environment will not work. Sigh.. feel like an idiot right now.
Ah yes, you do have to run it as an Altiris job. These are tokens only utilized by Altiris and are different then the system variables like %windir% It is a learning process. Chalk it up and move on. No need to feel stupid.
deploy syspreped image with token script I'm having a problem. I have a sypreped image to depoly. In my distribute image job I have depoly image listed first and second the token script. In the depoly image part I have Automatically perform configuration task after completing this imaging task unchecked and Defualt Automation (auto-select) selected in Automation pre-boot environment. I am using winpe as my bootworks automation partition. I boot into bootworks automation to deploy the image, it gets deployed but the script never after works. The PC reboots and sysprep runs. The messaage I get in the depoly image job is fail to boot to automation. What am I Doing wrong. Jim
First off, are the temporary token replaced files getting created on the DS? If so, REM out any k/b and screen locks and put a pause statement in at the end of the token replace and firm copy script. Then you can see if your script is copying down the right token replaced file.
Hi Thank you for the reply. I am running the replace token script in the same job as the deploy image how do i know if the files are being created on the DS. I am running the script in DS after my depoly image . JIm
The command to do the token replacement should have, as its second argument, a destination for the file after the tokens have been replaced. Look there: Code: REM ReplaceTokens .\temp\sysprep.inf .\temp\%COMPNAME%.txt In this case its in the temp directory in the express share. Don't forget that the token replace script should start with REM, be set to run on the target machine, even though it actually runs on the server and that the tokens in it are case sensitive (usually all uppercase). Page 232 of the DS 6.9 manual gaive some good guidance. The command itself may be case sensitive, I'm not sure.
Thank you for the assistance. The issue I,m having though is this: the image gets deployed through winpe bootworks. Afer the image is deployed the pc never boots back into bootworks to run the script. It boots directly into windows xp and sysprep runs. So I don,t think my replace token script ever runs.. How do I set up the deploy image job so that after the image is depolyed the pc will boot back into bootworks automation and run the replace token file script??
for the replace token script, Do I run the script on the client computer or locally on the deployment server (with run when the aget is connected is checked)?? Sorry I'm new to this hardware independed imaging stuff. JIm
Another thing to look at is your image job. Near the bottom, right above choosing the type of automation, is a checkbox: Automatically perform Configuration Task, if that is checked it won't care that there is a script that needs to run second, it'll boot into Windows to perform that configuration. So make sure it's unchecked and the script should run while still within the automation after imaging.
I apologize now, I am fairly new to this. I have the job setup with 2 tasks. 1. Distribute Disk Image, "Automatically perform" is unchecked 2. Run Script "REM Token Replacement / Driver Injection echo Hardware Model number is %#!computer@model_num% F:\RDeploy\Windows\FIRM -recurse Copy "F:\drivers\%#computer@model_num%\*" "prod:\drivers" " script operating system = windows Script Run Location: Locally on the DS Run when the agent is collected The script is not running, i am assuming because no files are being copied, and i do not ever see the echo from above. Any ideas?
On the second page of the script job, try running the script from the local computer and make sure the Client Run environment is set for Automation. That's how mine runs post-image and it's pretty flawless.
Put a pause at the end of that script to see if it does run. I don't think you can put a DS token like %#computer@model_num% as a command line variable. You would have to run it as a batch file and do the Token replacement on the batch file first. Appendix B of the DS 6.9 manual has a much better section explaining how tokens work.
DS variable should work We are using DS variables in DS-script, but with xcopy insted of firm, we did not get firm to work previus, probably because we did the "rem BOOTWORK UNLOAD" before the firm copy commands. This works fine for us: xcopy %undir%\Drivers\%#!computer@model_num%\*.* %filedir%\drivers\ /s /e /y > nul