FN-GM Posted August 1, 2012 Posted August 1, 2012 Hi, I wish to create an SCCM package that will copy down some .jpg files to the machine. I have created the package, it works just fine and copies the files down no problem, but SCCM tells me it has failed. I have put this into the program command - robocopy "source" "C:\destination" /mir Does anyone know how to prevent it reporting back as failed please? Thanks
ChrisH Posted August 1, 2012 Posted August 1, 2012 Robocopy probably isn't giving a correct exit code. You may have to use some kind of script wrapper to pass the desirable code.
Theblacksheep Posted August 1, 2012 Posted August 1, 2012 add the reported correct safe error codes to the sccm package.
FN-GM Posted August 1, 2012 Author Posted August 1, 2012 Hi @ChrisH & @Theblacksheep please can you expand a little please? Do you know how i can do these steps please? Thanks
Steve21 Posted August 1, 2012 Posted August 1, 2012 If you can use multiple lines you should be able to do: Robo..... Exit /B 0 Just makes it force return 0 (which is normally successful exit) might want to check that for sccm though! But that will always return success, but due to robo's stupid exit code system not much choice without using lots of if statements Steve 1
Theblacksheep Posted August 1, 2012 Posted August 1, 2012 Hi @ChrisH & @Theblacksheep please can you expand a little please? Do you know how i can do these steps please? Thanks Make sure your command is correct and the results (besides the exit code) is correct. Dunno much about robo exit codes personally, check what you are getting is OK. SCCM defaults for exit codes for success (0), reboot (1604,1641,3010,3011), retry (loads). If it looks OK, you can add other exit codes to report as correct. Have a play, take a look at the options on the command line for whatever package you are using. it'll list success error codes (like 0) add your custom exit code number here and it'll report as success. 1
ChrisH Posted August 1, 2012 Posted August 1, 2012 Robocopy exit codes Robocopy Exit Codes Look in the properties of the package for exit codes as suggested or use Script to test the exit code by an application - Adnan Ezzi parts of this code to write a script to get the code then return the desired code back to sccm. 1
FN-GM Posted August 1, 2012 Author Posted August 1, 2012 Thanks Guys. I might find the exit code and tell SCCM to go off that. I have had a quick look to see if i can change it in a package and cant see it. It must be to late, will look in the morning. Thanks
FN-GM Posted August 2, 2012 Author Posted August 2, 2012 @ChrisH i cant find this in SCCM 2012 but where can i change the default exit codes on a package please? Thanks
ChrisH Posted August 2, 2012 Posted August 2, 2012 @FN-GM I don't think there is an option to change the codes if it is a package, you will need to script it. You can set it as an application though if you do a custom app and not auto detect. Once it is set up you go to properties > Deployment Types > Edit > Return Codes. I haven't had to use this method with a script before though so I don't know how well it will work.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now