Link to home
Start Free TrialLog in
Avatar of newtontech4
newtontech4

asked on

Help with executing remote commands using ROBOCOPY

Using combination of WMIC and ROBOCOPY to execute remote batch script.

WMIC is charged with executing the remote command line and running a batch script:
C:\>WMIC.EXE /NODE:CORPBACCONBPM /User:CORPBACCOBBPM\richo /PASSWORD:mypassword
  Process Call Create Commandline=C:\netcopy.bat

The above referenced netcopy.bat executes a ROBOCOPY command
robocopy "C:\C1" "X:\C2" /MIR /COPYALL /V /NC /NDL /NP /B /NFL /LOG:"C:\MYLOGFILE.log" /R:10 /W:30 /ETA

When deploy.bat is executed I get the error:
NTFS Security may not be copied - Destination may not be NTFS.

I am able to execute deploy.bat wihtout issue while on the remote console.

Thanks!
Avatar of SteveGTR
SteveGTR
Flag of United States of America image

Here's some information on this. Look at the last couple of comments:

https://www.experts-exchange.com/questions/21446873/Robocopy-1-95-Where-can-I-get-it.html
Avatar of newtontech4
newtontech4

ASKER

Hi Steve -

Thanks but still can not get beyond the error:
NTFS Security may not be copied - Destination may not be NTFS.
Is the destination drive NTFS or FAT?
NTFS  I have also tried the robocopy with the /SEC switch - what is weird is that this works if I run the robocopy command from the console of remote machine.  In other words take the WMIC out of the picture.  This also happens when I am using psexec..  thanks
You've also tried using a UNC in place of X:?
No- wll give it a try - thank you.
this is my output following the use of UNC  - I also used fully qualified domain name

Started : Mon Oct 15 15:13:19 2007

   Source : C:\C1\
     Dest : \\corpbaccenter\C2\

    Files : *.*
          
  Options : *.* /V /NC /NDL /NFL /S /E /COPYALL /PURGE /MIR /B /NP /ETA /R:10 /W:30

------------------------------------------------------------------------------

2007/10/15 15:13:19 ERROR 5 (0x00000005) Changing File Attributes C:\C1\
Access is denied.

Waiting 30 seconds...
ASKER CERTIFIED SOLUTION
Avatar of SteveGTR
SteveGTR
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Steve -

Is the /B something built in?  I am not using it in my command arguments.

I will run the WMIC as a different user.

Thanks
Rich
I was looking at your robocopy command:

robocopy "C:\C1" "X:\C2" /MIR /COPYALL /V /NC /NDL /NP /B /NFL /LOG:"C:\MYLOGFILE.log" /R:10 /W:30 /ETA

According to the help on my version of robocopy this is the backup mode switch.
Forced accept.

Computer101
EE Admin