Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: How to sync a UNC path to a USB memory stick in Windows?

by pKai (Priest)
on May 31, 2006 at 07:56 UTC ( [id://552705]=note: print w/replies, xml ) Need Help??


in reply to How to sync a UNC path to a USB memory stick in Windows?

A few things in random order:
  • If you can map the UNC resource and copy to it as a drive letter, you should also be able to copy to the UNC path directly. There is no special magic in the drive letter mapping and xcopy can handle that without problems.
  • As you say you are not very familiar with UNC: Have you checked the correctness of your path? Your sample code reads $source="\\\\server\\dir\\files\\";. So "dir" is a "share" provided by server?
  • Using robocopy.exe instead of xcopy is more flexible. At least I always prefered that for the last ten years for such synchronisation task under Windows. Additional pro is better error messages in case of failure. Cons would be that you have to grab a copy of robocopy from a "Windows Resource Kit" and copy it to the machine for using.
  • When you go the road with using Perl built in copy mechanism/modules, be aware that all path separators can be written as forward slashes, (i.e. $source = "//server/share/dir";) because the underlying API did allow that since earliest DOS times; only the DOS command prompt forces you to use backslashes.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://552705]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2024-03-29 09:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found