Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Xcopy vs Copy with UNC paths  (Read 37768 times)

0 Members and 1 Guest are viewing this topic.

txtesta

  • Guest
Xcopy vs Copy with UNC paths
« on: March 23, 2007, 08:45:51 AM »
Users have shortcut on their desktop that points to a simple bat file (see below)
The batch file creates a new folder on user's hard drive, if needed, then copies an Access front-end file (.mdb) from a network folder down to the hard drive.

I was using xcopy so that it only copied the file, IF I had made a change.

I recently had to change to using UNC paths and now that XCopy doesn't seem to work.  I can only get it to work for the users with a straight copy.  XCopy works fine on my PC.  Just before the copy is executed there is a message that "UNC Paths are not supported"

Am I doing something wrong?  Is there a delay with the xcopy on the network that I need to "pause" or something?

Any help is appreciated.
TJ
---------
@Echo Off

Rem Check for local copy of XYZ.mdb - if not found, create directory and copy file.
if not exist "C:\TEST1\XYZ.mdb" mkdir "C:\TEST1"

if not exist "C:\TEST1\XYZ.mdb" copy "\\PBNTFS99\SHR_access\CLO\XYZ.mdb" "C:\TEST1\XYZ.mdb" /y
 
Rem xcopy the latest version from server to hard drive

xcopy "\\PBNTFS99\SHR_access\CLO\XYZ.mdb" "C:\TEST1\XYZ.mdb" /y /d

start /max /HIGH C:\TEST1\XYZ.mdb
-------
I had to change the xcopy line to the following to get it to work:
copy "\\PBNTFS99\SHR_access\CLO\XYZ.mdb" "C:\TEST1\XYZ.mdb" /y

lafter

  • Guest
Re: Xcopy vs Copy with UNC paths
« Reply #1 on: March 26, 2007, 10:02:50 AM »
Try mapping the network drive first before your copy .. then deleting the drive after the copy

IE:

@Echo Off

Net Use :V \\PBNTFS99\SHR_access\CLO
 
Rem Check for local copy of XYZ.mdb - if not found, create directory and copy file.
if not exist "C:\TEST1\XYZ.mdb" mkdir "C:\TEST1"
 
if not exist "C:\TEST1\XYZ.mdb" copy "V:\\PBNTFS99\SHR_access\CLO\XYZ.mdb" "C:\TEST1\XYZ.mdb" /y
 
Rem xcopy the latest version from server to hard drive
 
xcopy "V:\\PBNTFS99\SHR_access\CLO\XYZ.mdb" "C:\TEST1\XYZ.mdb" /y /d
 
start /max /HIGH C:\TEST1\XYZ.mdb

Net Use :V /delete
-------
I had to change the xcopy line to the following to get it to work:
copy "\\PBNTFS99\SHR_access\CLO\XYZ.mdb" "C:\TEST1\XYZ.mdb" /y