Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2296
  • Last Modified:

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!
0
newtontech4
Asked:
newtontech4
  • 5
  • 5
1 Solution
 
SteveGTRCommented:
Here's some information on this. Look at the last couple of comments:

http://www.experts-exchange.com/Networking/Misc/Q_21446873.html
0
 
newtontech4Author Commented:
Hi Steve -

Thanks but still can not get beyond the error:
NTFS Security may not be copied - Destination may not be NTFS.
0
 
SteveGTRCommented:
Is the destination drive NTFS or FAT?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
newtontech4Author Commented:
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
0
 
SteveGTRCommented:
You've also tried using a UNC in place of X:?
0
 
newtontech4Author Commented:
No- wll give it a try - thank you.
0
 
newtontech4Author Commented:
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...
0
 
SteveGTRCommented:
I'm guessing that this is caused by the /B switch trying to set the archive attribute on the local file. This might occur if the account you are running WMIC under doesn't have access to change attributes on the remote drive (c:\c1).
0
 
newtontech4Author Commented:
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
0
 
SteveGTRCommented:
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.
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now