Jump to content

RunAsSet - RunWait, again


MrEd
 Share

Recommended Posts

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.

Link to comment
Share on other sites

...

try using this:

RunAsSet("testUser",@ComputerName,"password")
RunWait(@ComSpec & " xcopy " & @DesktopDir & "\From "& @DesktopDir & "\To" &@DesktopDir,@SW_MINIMIZE)
That is attempting to append the desktop directory to the end of the destination path, here is the error

RunWait(@comspec & " xcopy " & @desktopdir & "\From " & @DesktopDir & "\To" & @DesktopDir,@SW_MAXIMIZE) 
The directory name is invalid.
Link to comment
Share on other sites

  • Developers

RunWait(@comspec & " /c xcopy " & @desktopdir & "\From " & @DesktopDir & "\To", "" ,@SW_MAXIMIZE)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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