Jump to content


  • 0
Marcosoft

SCCM Batch file Deployment on Win 7

Question

I am new to SCCM, and I'm having problems with a batch file running automatically from cache on a Windows 7 machine,

 

I created a package with two programs, both are set to deploy locally and run from cache, using a unc path and to run with admin rights and to deploy whether the users logged in or not.

 

I have set the main program to run the msi and transform file via a command line which runs and installs fine.

 

The problem is with the second linked program, its a batch file, with a simple xcopy command such as xcopy "%~dp0Redirect.txt "c:\program files\example"

 

It fails to execute automatically, although it runs ok manually from cache when I "run as administrator" and I understand the UAC comes into force since

I want to copy a file into the Program Files area, although I thought deploying/running the program with admin rights "elevates" the rights for the user from SCCM so a specific app can install, so I didn't this would be the reason why it fails to run, is there anything I'm missing?

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Thanks for your replies,

 

Myself and my colleagues are new to SCCM coming from a Novell "Zenworks environment". We have just recently migrated to an AD environment, and are starting to use the tools to go with it. All the programs we have packaged so far that include batch files fails to execute. Athough all of the MSI's deploy and run successfully as you'd expect, and the batch scripts are correct as they execute when you run them manually from cache.

 

The batch files we use and have problems with all have different complexity depending on the app and all execute manually successfully, but all i want to do with one program is to copy a file from the cache location into its software app folder within program files on a Window 7 32bit machines, its simply just a one line xcopy command such as

 

xcopy "%~dp0Redirect.txt "c:\program files\shaunsoft\CTX"

 

basically want to copy Redirect.txt. into the "c:\program files\shaunsoft\CTX" folder

 

I also tried running it from the command line "redirect.bat" to deploy directly from the DP but still no joy.

 

Eventually we are looking to purchase a MSI packager such as Admin Studio etc, but batch files are regularly used with SCCM, so it's strange why we are experiencing such an issue.

 

I'm clutching at straws, but Is there anything on the SCCM end needing configured differently, to help push them to execute, we bought in consultancy to configure the SCCM server etc and to package a few apps, although they were MSI only packages, and the consultant was unsure why the batch files were not executing either.

 

Is there anything standard that may have been mis-configured/disabled at the SCCM administration.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.