Skip to content

XCOPY Error 4?

Featured Replies

I'm trying to create a package that just copies a few files, but no matter what I do in SCCM, it fails with exit code 4. Here's what I want to do:

 

xcopy "\\server\path\to\foo\*" "C:\Users\Public\Desktop\Foo\" /E /Y /C /I

 

Here's what I've tried:

  • Run it myself - Works
  • Put it in a batch script that creates C:\Users\Public\Desktop\Foo before running xcopy. Foo gets created but xcopy fails.
  • Run that batch script myself - Works
  • Uncheck "contains source files" and drop xcopy directly into the command line - fails
  • Create an everyone-full control folder on C:\ and tell SCCM to xcopy cmd.exe to C:\Folder - Works
  • xcopy \\server\...\foo\* C:\Folder - fails

I have the task set to run whether or not someone is logged in, but it's almost as if xcopy is ignoring it and refuses to write the files.

 

 

 

I've also tried to use robocopy, but the advertisement has stopped updating on the client. Wait, actually it looks like it requires a machine policy force, a reboot and 10 minutes to update. That can't be right. How do I make the client update faster?

 

I've spent two whole days troubleshooting this mess. It shouldn't be this hard to copy a folder.

 

Edit: Ok, so it finally updated to use robocopy, but that's failing with error 16: insufficient privileges.

Hi,

The sccm client uses the System account to run commnads on the client computers so make sure you have added permissions to the share for Domain Computers otherwise you will get access denied.

Regards,

Jörgen

  • Author

D'oh!

 

Oh well, none of the other threads with this problem got solved, so hopefully this will be useful to someone else.

 

Thanks!

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.