XCOPY does not work

Guido

New member
Joined
Mar 16, 2023
Messages
4
Reaction score
0
We use xcopy running as a batch file. It copies files from a NAS to an External USB Drive. The syntax we use is as follows : Xcopy \\NAS\FILES E:\FILES /s /e /c /r /k /h /d /y It opens and closes within a second but it does not run. Your help is appreciated
 

RogerOver

Well-known member
Joined
Jun 14, 2022
Messages
412
Reaction score
57
An "acces rights" problem ?
AFAIK, batch files cannot be run "as Administrator". You neet to create a shortcut to the batch file and run the shortcut "as Administrator" (rightclick the shortcut, find the shortcut tab, click on "Advanced").
 

Vote:

Bighorn

Well-known member
Joined
Feb 27, 2023
Messages
671
Reaction score
96
My thought, does the command work when entered in the Command Prompt manually? If so, create the .bat file then if it will never need changing, use a solution from the Internet to convert that .bat file to an .exe/executable. But there is a possibility of a variable involvement, changing of the USB drive letter which can happen using a different drive or a different port.

 

Vote:

Guido

New member
Joined
Mar 16, 2023
Messages
4
Reaction score
0
An "acces rights" problem ?
AFAIK, batch files cannot be run "as Administrator". You neet to create a shortcut to the batch file and run the shortcut "as Administrator" (rightclick the shortcut, find the shortcut tab, click on "Advanced").
Thank you for your reply.
I had done this already. It was my mistake, I assigned the wrong drive letter to the USB drive.
However, we still have a problem. When we run it as administrator, we have to input the Administrative username and password every time.
Can we assign administrative privileges once.

Regards,
Guido
 

Vote:

Guido

New member
Joined
Mar 16, 2023
Messages
4
Reaction score
0
My thought, does the command work when entered in the Command Prompt manually? If so, create the .bat file then if it will never need changing, use a solution from the Internet to convert that .bat file to an .exe/executable. But there is a possibility of a variable involvement, changing of the USB drive letter which can happen using a different drive or a different port.

Thank you for your reply.
Please read my reply to Roger.
Regards,
Guido
 

Vote:

Bighorn

Well-known member
Joined
Feb 27, 2023
Messages
671
Reaction score
96
Thank you for your reply.
I had done this already. It was my mistake, I assigned the wrong drive letter to the USB drive.
However, we still have a problem. When we run it as administrator, we have to input the Administrative username and password every time.
Can we assign administrative privileges once.

Regards,
Guido
As far as I know only by turning UAC off.
 

Vote:

RogerOver

Well-known member
Joined
Jun 14, 2022
Messages
412
Reaction score
57
Sorry Guido,

... but I have no answer !
(I am wondering however, if the problem is not on the other side. Who is the owner of the USB drive = the drive you called "E" in your first contribution ?)
 

Vote:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top