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.
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.
If you don't have it already, then
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.