Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Network batch file help

Jul 26, 2008 2:44AM PDT

I am trying to make a batch file that will :
1)allow user input for the destination of the network computer to copy files from

2) copy a file from the unit POS to the destination

heres what I have so far can you help me with what im missing

@Echo off
SET /P POS=[Enter the POS to copy files from]
** DEL "C:\Documents and Settings\All Users\Desktop\*.*"
XCOPY "%POS%\Documents and Settings\All Users\Start Menu\Programs\Startup\test.txt" "C:\Documents and Settings\All Users\Desktop\"/y

for the format of the pos to copy from i can enter either

\\pos1234-123
or
pos1234-123

Discussion is locked

- Collapse -
Never going to happen.
Jul 26, 2008 3:59AM PDT

The DOS batch programming language doesn't have a feature to input a variable so given only the old DOS batch programming language you won't get this done.
Bob

- Collapse -
Research is the key
Jul 26, 2008 11:02AM PDT

Might think about some research before you answer questions.
quite possible and after some messin around got it workin like a charm

@ECHO OFF
SET /P POS=Enter the POS to copy files from:
DEL /q "C:\Documents and Settings\All Users\Desktop\*.*"
COPY "\\%POS%\c\Documents and Settings\All Users\Start Menu\Programs\Startup\StartPOS.cmd" "C:\Documents and Settings\All Users\Desktop\"

- Collapse -
SET /P doesn't work in DOS.
Jul 26, 2008 11:53PM PDT

Next time tell exactly which command interpreter was going to be used.

The /P failed on my old Windows 98 machine but worked on XP.
Bob