Solved

Script to transfer file from A to B

Posted on 2006-11-14
13
247 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

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 250 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
This is about my first experience with programming Arduino.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

778 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