Xcopy - file copy.

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
gigaaks
Posts: 11
Joined: 28 Sep 2012 11:42

Xcopy - file copy.

#1 Post by gigaaks » 30 Sep 2012 19:29

Hi

I want to copy a file from \\serverx.x.x.x\drive$\location\somefile.extension to my local computer.

xcopy /v /y \\10.21.21.121\f$\CMBuild\build_05_07_00_235_copy\DB\Upgrade.bat .

When I run this command in cmd prompt, it works fine and when I put this line in a .bat file and run the .bat file from cmd prompt it works fine.

When I call the above bat file from Jenkins, it gives me an error.

21:15:29 Invalid drive specification
21:15:29 0 File(s) copied



What the heck? Why DOS doesn't work when we need to.

NOTE: All other command which are in the same .bat file are working fine when I'm calling from Jenkins, commands like echo, del, mkdir, etc .

Now, when I replace XCOPY with copy, it works from cmd / running .bat from cmd prompt. but when running from Jenkins, its gives, provide your userid/password to access the file.
Logon failure: unknown user name or bad password.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Xcopy - file copy.

#2 Post by foxidrive » 30 Sep 2012 20:16

What is Jenkins?


If it is running in a shell there could be restrictions. Try this:

cmd /c "copyfiles.bat"



You may also strike permissions issues if Jenkins is running with system account privileges.

Post Reply