MrEd Posted March 26, 2008 Posted March 26, 2008 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.
ludocus Posted March 26, 2008 Posted March 26, 2008 ... try using this: RunAsSet("testUser",@ComputerName,"password") RunWait(@ComSpec & " xcopy " & @DesktopDir & "\From "& @DesktopDir & "\To" &@DesktopDir,@SW_MINIMIZE)
MrEd Posted March 26, 2008 Author Posted March 26, 2008 ... 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.
Developers Jos Posted March 26, 2008 Developers Posted March 26, 2008 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.
MHz Posted March 27, 2008 Posted March 27, 2008 I left out the " /c " so I could see the results of the command if/when it works.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.
MrEd Posted March 27, 2008 Author Posted March 27, 2008 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now