Sign in to follow this  
Followers 0
MrEd

RunAsSet - RunWait, again

6 posts in this topic

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

:)

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0