Solved

Script to transfer file from A to B

Posted on 2006-11-14
13
234 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now