Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am running SCCM '07 and building a Windows 7 x86 image using OSD and a Task Sequence. During the TS I do an "Install Software" step to install Adobe Flash. The program for flash is a batch file using relative paths (no hardcoded paths. I am assuming that the program will be run from the cache and use the cached folder for the path). The program works just fine when I advertise it to a machine, but when it's run from the TS in the OSD it defaults the path to C:\Windows (most likely because it's trying to use a UNC path). I do a search on the hard drive and it doesn't appear that the progrm was cached at all. Any suggestions on what I'm missing or what I can do to set the path to be used for the program or, even better, to cache the program so it runs locally? Thanks for your time.

share|improve this question

2 Answers 2

How are you running the batch file? Is it an "Install Software" step using an SCCM package, or is it a "Run Command Line" step? This makes a big difference to how you use and control batch files.

If you're using an "Install Software" step then all you should need to do is make sure you've got the Source location specified properly in the Package properties, and that you've got the command line right in the Program (along with leaving the "Start In:" box blank) and as always make sure the "Allow this program to be installed from the Install Software task sequence..." box is ticked.

If you're using a "Run Command Line" job, then after checking the same as above for its package, make sure that you've ticked the "Package" box in the step's properties, have specified the correct package that contains the files, and haven't specified anything in the "Start In" box.

Presume that the package is correctly out on the distribution points, else the Task Sequence should fail at the initial "Checking dependencies" step, but just in case you can run the SCCM report "Packages referenced by a specific task sequence" (in the Task Sequence - References" category) to check the distribution status of all the packages used by your TS.

Finally the SMSTS.log on the client machine should show the exact command lines being run at each step, where the files have been downloaded to (if at all) and what the current working directory is at the time the command is run. It's a huge file, and a pain to go through but does give you all the info. If you're using a batch file, you can also ECHO any useful info and it should show up in that log too. On a machine that's successfully run the entire build process the log will end up in either "C:\Windows\System32\CCM\Logs" or "C:\Windows\SysWOW64\CCM\Logs" depending on how much info has been logged you may find that the early steps of the task sequence have been archived in a smsts-date- time.log file.

If you don't have it already, then trace32.exe from the SCCM 2007 Toolkit is highly recommended to take some of the pain out of reading SCCM's logs. It's a tiny little log viewer app that understands SCCM's log format and highlights lines with potential errors or warnings.

share|improve this answer

When you install software with a batch file in SCCM, you have to run it with drive letter (in the program properties) and you have to set it to run form distribution point (in the advertisement properties). Obviously in a TS you can't do the second bit, but make sure you do the first bit and it should work just fine.

share|improve this answer
    
Batch files run fine in a download and execute scenario with no need for a drive letter, as they're moved to the local machine's cache before execution. You just have to remember to just use a relative path (or bare filename) to run it rather than a fully-qualified path. Using download and execute and properly specifying the package to run from generally runs a TS faster, and allows you to generate Offline TS Media easily, for disconnected (or slow-link) builds. –  GAThrawn Jan 25 '12 at 17:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.