?
Solved

Script to transfer file from A to B

Posted on 2006-11-14
13
Medium Priority
?
274 Views
Last Modified: 2010-05-18
Hello,

I am looking for a way in which to copy some files from one network server to another (using the easiest method in Windows or using a quick tool. I would like to be able to specify the source location via full UNC and the destination location via full UNC. It sounds simple but how can i do this and is it fairly straight forward ?

Thanks

GISVPN
0
Comment
Question by:gisvpn
  • 7
  • 6
13 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 17937000
Hi gisvpn,

robocopy \\source\file \\destinatiopn\file

Cheers!
sunnycoder
0
 

Author Comment

by:gisvpn
ID: 17937006
hey sunnycoder thansk for the reply thanks. Looks good. Are there any problems using robo copy ? I.e. can the UNC be as long as I like are there any restrictions at all on robocopy?

Also does the file adopt the permissions of the destination ?


Thanks

Ollie
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 17937039
Hi gisvpn,

> Also does the file adopt the permissions of the destination ?
Robocopy is capable of perserving permissions that were present at the source
http://support.microsoft.com/kb/310316

There has to be some limit on UNC length but I am presuming, it would not be a small quantity ... I am not sure of the exact number but it is greater than 256 unless you explicitly add a /256 switch to enforce an error.

Cheers!
sunnycoder
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:gisvpn
ID: 17937061
ok great thank you :)
0
 

Author Comment

by:gisvpn
ID: 17937083
just a quick side questions, is it possible to create a folder and set the permissions of that folder ?
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 17937094
You mean create a folder while copying and maintaining the same permissions on the other end - yes
0
 

Author Comment

by:gisvpn
ID: 17937102
No I would like to create a new folder and set the permissions and then copy the files into that folder and the files to adopt the permissions of the folder that was just created :)
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 17937135
Unless you explicitly use /Sec or /Secfix  switch, robocopy wont update/modify permissions at the destination ... The permissions that you explicitly apply there would  remain effective.
0
 

Author Comment

by:gisvpn
ID: 17937147
ok but how would i create and set the permissions on the folder in the first instance ? :)
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 17937176
If it is one time process, right click -> New folder
I am not sure if this can be done via batch script ... But a sure shot work around would be to create the folder locally and then copy it!
0
 

Author Comment

by:gisvpn
ID: 17937201
well there are about 500 folders to be created in a structure and then each permissioned ? Can it not be done via script ?!
0
 
LVL 45

Accepted Solution

by:
sunnycoder earned 1000 total points
ID: 17937264
locally yes, remotely - not sure
What does the structure look like? Do you have directory structure at the source machine?
0
 

Author Comment

by:gisvpn
ID: 18026210
Great thanks for the info
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
When you discover the power of the R programming language, you are going to wonder how you ever lived without it! Learn why the language merits a place in your programming arsenal.
Simple Linear Regression
Loops Section Overview

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question