tibe87 Posted April 7, 2014 Report post Posted April 7, 2014 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? Quote Share this post Link to post Share on other sites More sharing options...
Apexes Posted April 7, 2014 Report post Posted April 7, 2014 Try setting the deployment to run from the distribution point, rather than download locally Quote Share this post Link to post Share on other sites More sharing options...
wilbywilson Posted April 7, 2014 Report post Posted April 7, 2014 You should try using the "%dp0" variable: http://www.ntcenter.ca/tools/sccm-sms-and-batch-scripting http://www.myitforum.com/articles/8/view.asp?id=12036 Quote Share this post Link to post Share on other sites More sharing options...
tibe87 Posted April 7, 2014 Report post Posted April 7, 2014 @Apexes Already tried, but not working. @wilbywilson Can you edit my script using the variable? I really don't know how to use it. Quote Share this post Link to post Share on other sites More sharing options...
GarthMJ Posted April 7, 2014 Report post Posted April 7, 2014 Why do you have ISS file on a UNC share? Why not included it with the packages? It will cause you problems if you don't. Quote Share this post Link to post Share on other sites More sharing options...
Peter33 Posted April 7, 2014 Report post Posted April 7, 2014 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. Quote Share this post Link to post Share on other sites More sharing options...
tibe87 Posted April 8, 2014 Report post Posted April 8, 2014 @Peter33 Can you show me how? Quote Share this post Link to post Share on other sites More sharing options...
Peter33 Posted April 8, 2014 Report post Posted April 8, 2014 @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. Quote Share this post Link to post Share on other sites More sharing options...
tibe87 Posted April 8, 2014 Report post Posted April 8, 2014 @Peter That worked like charm:) Thanks a lot! %~dp0 is a life saver. Quote Share this post Link to post Share on other sites More sharing options...