Jump to content


tibe87

Deploy bat file with SCCM 2012

Recommended Posts

Hello, this is my first post and I am glad to join windows-noob forum. I am a noob and new to SCCM and I hope I will find some help here.

 

I am having troubles deploying a simple batch script that will remove some installations.

 

Content of the script:

@echo off

::Silent remove openedge 10.1B
"C:\Program Files\InstallShield Installation Information\{874D5CE4-F913-4D5B-A6D4-CC129785B5C8}\setup.exe" /s /f1\\srvsccm01\sources$\Uninstall\proalpha5.1\add.iss /Z /Q

::Silent remove proalpha 5.1
MsiExec.exe /X{09FD2FA3-330F-4E8A-BF33-078C8B5D1032} /qn

::Silent remove proalpha Analyzer 7.0
MsiExec.exe /X{D8BF41E2-D1C0-4A85-9DE9-D16675FA904C} /qn

 

If I copy the bat file to a client and run it locally it will work 100%.

 

This is what I did on my SCCM.

- I have copied the bat file to the sccm server: \\srvsccm01\sources$\proALPHA5.2\pa-client-silent.bat

- Created a new package with the source files mentioned above

- In command line window I just selected my bat file from the above location.

- configured to run it with UNC name

 

Then I deployed it to my test machine with the option: Download content from distribution point and run locally.

However it will not work. SCCM will tell me that the deployment was succesful and 100% compliance but the script is not running.

I can easily deploy MSI applications and it will work.

I think my issue here is working with UNC paths in bath file.

 

Can someone help me?

 

Share this post


Link to post
Share on other sites

Why are you not including the iss file to your package and copy it to c:\windows\temp or something like that?

You are trying to access a share with a local system account when you run the script like that. Never a good idea.

Share this post


Link to post
Share on other sites

@echo off

::Silent remove openedge 10.1B
"C:\Program Files\InstallShield Installation Information\{874D5CE4-F913-4D5B-A6D4-CC129785B5C8}\setup.exe" /s /f1"%~dp0add.iss" /Z /Q

::Silent remove proalpha 5.1
MsiExec.exe /X{09FD2FA3-330F-4E8A-BF33-078C8B5D1032} /qn

::Silent remove proalpha Analyzer 7.0
MsiExec.exe /X{D8BF41E2-D1C0-4A85-9DE9-D16675FA904C} /qn

Well the %~dp0 is probably the better and easier way. Just copy the iss to your package source folder, like you did with the batch, edit the batch file, and update your Distribution Points.

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
Reply to this topic...

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