Jump to content


  • 0
capriguy84

How to run a BATCH file in a Program(pkgs)

Question

Hi,

 

I am confused with the online documentation on running a batch file from in a TS. Basically, I am installing a software using batch file.

 

My package source contains: app.exe, configfile.ini, regfix.reg, INSTALL.bat.

 

I'd like to create a program to just run the bathc file which works on the config files & exe. So after some online ref. I used below format but it does not work.

 

commandline: %~dp0INSTALL.bat

 

Any ideas?

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

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 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 from SCCM would resolve this, is there anything I'm missing?

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.



×
×
  • 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.