Jump to content

Recommended Posts

Posted

I am trying to xcopy a directory from an Active Directory share into the users Program Files directory. After hours of failed attempts I decided to start small with the following local file copy.

RunAsSet("testUser",@ComputerName,"password")
RunWait(@ComSpec & " xcopy " & @DesktopDir & "\From " @DesktopDir & "\To",@DesktopDir,@SW_MINIMIZE)

The following is displayed in the output window

RunWait(@ComSpec & " xcopy " & @DesktopDir & "\From " @DesktopDir & "\To",@DesktopDir,@SW_MINIMIZE) 
RunWait(^ ERROR

I left out the " /c " so I could see the results of the command if/when it works.

testUser is an administrator of the local machine and password is the actual password.

Posted

Replace /c with /k to keep the prompt open.

Another one to try.

RunWait(@ComSpec & ' /k xcopy "' & @Desktopdir & '\From" "' & @DesktopDir & '\To" /y', "" ,@SW_MAXIMIZE)

If you get an access error, then try setting a valid working directory to access.

:)

Nope

RunWait(@comspec & ' /k xcopy "' @desktopdir & '\From " "' & @desktopdir & '\To" /y',"",@sw_maximize) 
RunWait(^ ERROR

RunWait(@comspec & ' /k xcopy "' @desktopdir & '\From " "' & @desktopdir & '\To" /y',@desktopdir,@sw_maximize) 
RunWait(^ ERROR

Very confusing. RunWait(@comspec) opens a cmd window so it isn't that part of it. I am going to try and build a batch file in @tempdir then fire it off.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...