General discussion

Locked

xcopy bat file issues

By Seadogs ·
I am trying to copy a folder containing 8 files from a folder onto the network to my pc. I am using the xcopy command like so:
h:\xcopy users c:\station\users
The weired thing is if I navigate to the given directory, and type in xcopy users c:\station\users, it works fine. However if I run a script from the given directory with the exact same command, I see it copy the files at the command prompt, but when I go to look for the files, they aren't there. any ideas?

This conversation is currently closed to new comments.

10 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

xcopy bat file issues

by Gigelul In reply to xcopy bat file issues

Hi
You tried:
xcopy h:\users c:\station\users
Also maybe is necessary to give the path for xcopy:
c:\OSroot...\xcopy h:\users c:\station\users
In addition check xcopy options:
xcopy /?

Collapse -

xcopy bat file issues

by Gigelul In reply to xcopy bat file issues

For me works in prompt or in batch.
Post more detail:
-where are these two folder
-where is batch file
-who run this batch
-etc.

Collapse -

xcopy bat file issues

by Seadogs In reply to xcopy bat file issues

Poster rated this answer

Collapse -

xcopy bat file issues

by Seadogs In reply to xcopy bat file issues

thanks for these suggestions, but no luck with any of them.

Collapse -

xcopy bat file issues

by Pan 13 x In reply to xcopy bat file issues

use this :
Xcopy h:\users\*.* /e c:\station\users
the /e will copy everything including subdirectories even if the folder is empty. This command can be ran from any location.
Hope this helps!

Collapse -

xcopy bat file issues

by Seadogs In reply to xcopy bat file issues

Poster rated this answer

Collapse -

xcopy bat file issues

by Seadogs In reply to xcopy bat file issues

no luck with answer #2 either. the odd thing is that it works fine through the command line, but not for a .bat file.

Collapse -

xcopy bat file issues

by Still_learning In reply to xcopy bat file issues

Try the following in your batch routine:

h:
cd\users
xcopy *.* /e/v c:\station users

I think the problem is setting the path for the command. Hope this helps.

Collapse -

xcopy bat file issues

by Seadogs In reply to xcopy bat file issues

Bingo we have a winner! Thanks! this worked like a charm.

Collapse -

xcopy bat file issues

by Seadogs In reply to xcopy bat file issues

This question was closed by the author

Back to Windows Forum
10 total posts (Page 1 of 1)  

Related Discussions

Related Forums