Solved

Script to transfer file from A to B

Posted on 2006-11-14
13
220 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is about my first experience with programming Arduino.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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…

759 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

22 Experts available now in Live!

Get 1:1 Help Now