Solved

Script to transfer file from A to B

Posted on 2006-11-14
13
259 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
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!

 

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

Industry Leaders: 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

Suggested Solutions

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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 …

749 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