On Sat, 02 Jun 2012 08:46:32 -0500, John Price wrote:
>
> Hi
>
> I'm trying to write a BAT file to copy files from one computer across
> to another computer on the network. Sharing and permissions are granted
> to allow read/write. Both computers running Win 7. Can copy back and
> forth at will using Windows Explorer.
>
> The content I've got so far is
>
> CD\
> xcopy c:\forcopy\*.* \\MAIN-DESKTOP\c$\forcopy1 /D /E /Y
> pause
>
> but this returns an error "Invalid drive specifiction" when I run the
> BAT file containing it
>
> I've tried changing the $ sign to a colon, but same result.
>
> If I change the destination path to another folder on the source drive
> it works fine, so it must be something about the path as it's shown
> above. Or is this something that isn't possible.
>
> What's wrong?
>
> Many thanks
You need to precede that with a NET USE command, such as
net use p: \\main-desktop\C$
xcopy c:\forcopy\*.* p:\forcopy1 /D /E /Y
:: Optional, if you want to disconnect the mapped network drive.
net use p: /d
I assume no login is required for the network folder. If it is,
change the NET USE command to
net use p: \\main-desktop\C$ * /user:MyUsername
(substituting your actual user name, of course).
--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com
Shikata ga nai...