Re: Network Copy Batch file
- From: "Kerry Brown" <kerry@xxxxxxxxxxxxxxxxxxx*a*m>
- Date: Thu, 1 Feb 2007 20:41:19 -0800
I'm assuming P: is already mapped. You need quotes around the path that has the space in it.
del c:\plant\solid_4_0\default.dat
copy "p:\NetSetup_Solid_4_0\Registry settings\defaults.dat" c:\Plant\Solid_4_0\default.dat
Instead of using a .bat file use a .cmd file. To test the file (.bat or ..cmd) open a cmd prompt and run the file from there. That way the window will stay open after the file runs.
--
Kerry Brown
Microsoft MVP - Shell/User
http://www.vistahelp.ca
"Stoke" <Stoke@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:0BC93912-DE31-43D2-BC6B-9125812D06CA@xxxxxxxxxxxxxxxx
THanks for helping me out.
The batch file reads:
del c:\plant\solid_4_0\default.dat
net use p:
copy p:\NetSetup_Solid_4_0\Registry settings\defaults.dat
c:\Plant\Solid_4_0\default.dat
When I run it, the CMD window pops up and disappears so quickly that I can't
read it.
the first line is working since the default.dat file is gone.
When I run CMD and type in the commands line by line, the first 2 lines
work, although net use p: gives me a summary of the
Local Name P:
Remote name \\server\plant
Resource type Disk
Status OK
# Opens 0
# Connections 1
and then goes back to the c:\Documents and Settings\cpc> prompt.
The copy command tells me "The system cannot find the file specified"
I've double / triple checked my spelling, underscores, etc.
Where's my error?
"Pegasus (MVP)" wrote:
"Stoke" <Stoke@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:625182D5-ECA9-433E-B7B6-AC0876844494@xxxxxxxxxxxxxxxx
> I know exactly what I want to do from the old DOS days - trying to > figure
out
> how to do it in Windows format.
>
> Basically I want an icon on my desktop that will when clicked -
> 1 . erase a file from a specific location on my desktop
> 2. copy a file from a specified folder that is a mapped network drive > (
> p:\\server\plant)
> 3. paste it to a folder on my desktop (replacing the file erased in > step
1)
>
> Seems so simple, but I don't know how to do get the batch file to
recognize
> the network drive! I've tried messing around with the commands in CMD,
and
> can't seem to get it to recognize the file path to P:\. Keeps telling > me
> that the file isn't found. Can someone help me? THanks!
The old DOS commands still work but they are considerably enhanced.
You can access your network drives as if they were local drives, e.g.
P:\plant\*.txt
or with a UNC name:
\\Server\ShareName\Plant\*.txt
If you show us your batch file line and quote the error message
you see then someone will tell you how to get it right.
.
- Follow-Ups:
- Re: Network Copy Batch file
- From: Pegasus \(MVP\)
- Re: Network Copy Batch file
- References:
- Re: Network Copy Batch file
- From: Pegasus \(MVP\)
- Re: Network Copy Batch file
- From: Stoke
- Re: Network Copy Batch file
- Prev by Date: Re: CMD can't find D:
- Next by Date: Re: Security Centre
- Previous by thread: Re: Network Copy Batch file
- Next by thread: Re: Network Copy Batch file
- Index(es):
Relevant Pages
|