Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XCOPY Script to Network Share

Status
Not open for further replies.

ElijahBaley

IS-IT--Management
May 4, 2001
1,598
GB

Hello

I have a mobile user who is very rarely in the office - I would like to create a simple batch file that he can double click when he is docked and logged into our network which will copy all files a subdirectorys of my documents to a network share.

I have tried the following but it does not seem to work, probably due to Windows 2000 security? or is a DOS limitation - in any case if anyone can tell where I am going wrong or offer a usefull solution I would appreciate it:

xcopy c:\Documents and Settings\USER.DOMAIN\My Documents x: /e /y

Where x: is a mapped drive to a share on a server

Thanks

Graham

"r tape loading error"
 
I use this method frequently - does the user have permissions to write to x:?

"It does not seem to work . . ." More information?
 
Put quotes around the path like this:

xcopy "c:\Documents and Settings\USER.DOMAIN\My Documents" x: /e /y

 

Thanks for your quick responce.

I have posted this in the wrong forum, I should have posted in 2000pro - anyway the client machine is 2000pro and the share is on NT server.

When I run the batch I get a quick flash of a DOS window then it dissapears, when I check on the share no files have been copied?

I tried a test which did work:

xcopy c:\AAA x: /e /y

But when I tried:

xcopy c:\Documents and Settings\USER.DOMAIN\My Documents x: /e /y

No joy, ill try the "quotes" - do you think that I need to specify the destination share/folder name X:\backup or should it work with just the MAP to X:

Graham


"r tape loading error"
 
You have to use quotes with DOS commands because DOS isn't "smart" enough to handle spaces in file or folder names. As an example try creating a directory called "test 1" with the md command.

md test 1

The result is a directory called "test" but if you type:

md "test 1"

The result is a dir called "test 1"

Hope that explains it better.
 

Yup that did the trick,

Thanks for your help

Graham
"r tape loading error"
 
HI.

Using the /d option will give you faster copy (only newer files).

You should know that these method won't mirror the exact folder structure.
There are many other solutions with more options.
Here is a partial listing:

* xxcopy from

* Robocopy from the Windows 2000 (or NT) resource kit.

* MM from here:

* Rapid Backup from here:

And many other...

Bye
Yizhar Hurwitz
 
Thanks Everyone,

And thanks to Jazper, looks like a interesting utility

Graham
"r tape loading error"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top