runas could not execute the copy command

  • Thread starter Thread starter Faisal
  • Start date Start date
F

Faisal

Hi,

Trying to create a script to copy files using runas, but it is failing with:

"
C:\>runas /user:clas@domain "copy payment_initation"
Enter the password for clas@domain:
Attempting to start copy payment_initiation as user "clas@domain" ...
RUNAS ERROR: Unable to run - copy payment_initiation
2: The system cannot find the file specified.
"

How can this be resolved. I will be grateful for your help.


Regards
 
Faisal said:
Hi,

Trying to create a script to copy files using runas, but it is failing with:

"
C:\>runas /user:clas@domain "copy payment_initation"
Enter the password for clas@domain:
Attempting to start copy payment_initiation as user "clas@domain" ...
RUNAS ERROR: Unable to run - copy payment_initiation
2: The system cannot find the file specified.
"

How can this be resolved. I will be grateful for your help.

Is the file in the current folder? If not, you'll need to qualify the
copy command, i.e. "copy <drive>:\<folder>\payment_initiation".

Rick
 
Actually the error is it could not find copy command itself, as can be
seen as follows:

"
C:\>runas /user:clas@domain "dir"
Enter the password for clas@domain:
Attempting to start dir as user "clas@domain" ...
RUNAS ERROR: Unable to run - dir
2: The system cannot find the file specified.
"

There must be something fairly simple, which I am missing.
Regards
 
Fortunately found the solution, thanks:

C:\>runas /user:clas@domain /env "cmd /c dir"

Regards
 
Back
Top