Run batch file via SCCM

Hi I have problems getting a batch file to run via SCCM. I have done the following:

  • Created a new package and select option 'This package contains source files' and set the directory the folder that stores the batch file
  • Created new program and pointed this to the batchfile (shortcuts.bat)
  • Pushed the package to the distribution points, this has successfully transferred
  • Created advertisement, selected this package and set the program to the batch file (shortcuts.bat). This is set to download from distribution points and run locally and set against the required collection

The batch file does not run on the client and I am not sure what logs to check. The batchfile contains the following:

copy \\dmh-syscon1\softwaredeploymentpackages\shortcuts\coss2.url "c:\users\public\desktop"

It works fine if run manually on the client but not via SCCM. Can someone please advise what I have done wrong?

Thanks

Alistair

September 5th, 2012 7:24pm

SCCM is running the script using the computers system account so it doesn't have access to   \\dmh-syscon1 put the url in the package and copy the url over based on the relative path.
Free Windows Admin Tool Kit Click here and download it now
September 5th, 2012 7:32pm

Sorry Justin, not quite sure what you mean by 'put the url in the package and then copy the url based on the relative path'?

Thanks

Alistair

September 5th, 2012 8:49pm

Copy the coss2.url file into the same folder as the shortcuts.bat script. Update the script to contain the code below (Update the DP). This will copy the coss2.url from the same path of the script (For example the distribution point share or the local cache folder) not the \\dmh-syscon1\softwaredeploymentpackages\shortcuts\coss2.url.

copy %~dps0coss2.url "c:\users\public\desktop"		
Free Windows Admin Tool Kit Click here and download it now
September 5th, 2012 8:57pm

Here's a complete example: http://blog.configmgrftw.com/?p=332
September 5th, 2012 9:05pm

Copy the coss2.url file into the same folder as the shortcuts.bat script. Update the script to contain the code below (Update the DP). This will copy the coss2.url from the same path of the script (For example the distribution point share or the local cache folder) not the \\dmh-syscon1\softwaredeploymentpackages\shortcuts\coss2.url.

copy %~dps0coss2.url "c:\users\public\desktop"

Free Windows Admin Tool Kit Click here and download it now
February 11th, 2015 1:55pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics