Jump to content

Using Robocopy as an SCCM 2012 package Reporting back as failed when it hasn't


Recommended Posts

Posted

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

Posted
Robocopy probably isn't giving a correct exit code. You may have to use some kind of script wrapper to pass the desirable code.
Posted

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

  • Thanks 1
Posted
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.

  • Thanks 1
Posted

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

Posted
@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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...