Re: Network Copy Batch file



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.




.



Relevant Pages

  • Re: Bigloo vs. Python, features (was Re: Typed Python?
    ... in the C++ world there is "Putting Metaclasses ... the MOP is not the same as AOP: the MOP is a general framework which ... the "cmd" module in the standard library. ... I had only few commands, it was useful for me to have one-letter aliases: ...
    (comp.lang.python)
  • [PATCH 4/4] scsi: megaraid_sas - update version and Changelog
    ... +It looks like megaraid_sas at least needs this to throttle its commands ... When MegaSAS driver receives reset call from OS, ... +routine for max 3 minutes for all pending command completion. ... the driver just waits for cmd completion by FW. ...
    (Linux-Kernel)
  • [PATCH 4/4] scsi: megaraid_sas - update version and Changelog
    ... +It looks like megaraid_sas at least needs this to throttle its commands ... When MegaSAS driver receives reset call from OS, ... +routine for max 3 minutes for all pending command completion. ... the driver just waits for cmd completion by FW. ...
    (Linux-Kernel)
  • Re: Script to extract documentation from CMD.EXE & COMMAND.COM
    ... A wrapper for CMD help of Windows XP/2000. ... Temporaries files are used in the same directory ... list the internal commands of these two executables and perhaps also list ...
    (microsoft.public.scripting.vbscript)
  • Re: EXEC() Runs process in background
    ... > do a start, run, cmd to get a cmd shell. ... I think you can get the batch file to wait for ... >> Open up a command window and run your bat file in it. ...
    (comp.lang.php)

Quantcast