sri53 Topic Starter
Posts: 12
|
 |
« on: November 06, 2009, 03:38:43 AM » |
|
Hi All,
I am new to dos. I have to use some command which should accept source and destination path as command line arguments and the file name to copy. whenever i supply three arguments my functionality should work. how can i achieve this?
Thanks in advance.
|
|
|
|
|
sri53 Topic Starter
Posts: 12
|
 |
« Reply #1 on: November 06, 2009, 03:46:32 AM » |
|
can anybody please help me...
|
|
|
|
|
gpl
Thanked: 25 Posts: 546

|
 |
« Reply #2 on: November 06, 2009, 03:48:26 AM » |
|
What do you need help with ? Do you have to create a program to accept and process the parameters, or does this program already exist and you need to know how to supply parameters on the command line ?
|
|
|
|
|
sri53 Topic Starter
Posts: 12
|
 |
« Reply #3 on: November 06, 2009, 03:55:11 AM » |
|
thank you... i need a program for this.
|
|
|
|
|
gpl
Thanked: 25 Posts: 546

|
 |
« Reply #4 on: November 06, 2009, 04:18:58 AM » |
|
When you say program, you mean batch script ?
|
|
|
|
|
sri53 Topic Starter
Posts: 12
|
 |
« Reply #5 on: November 06, 2009, 04:22:26 AM » |
|
Actually speaking i do not know how to achieve this...(through batch file or command etc) Please give me possible ways. I am sorry as i am new to this forum as well as dos.
|
|
|
|
|
gpl
Thanked: 25 Posts: 546

|
 |
« Reply #6 on: November 06, 2009, 04:50:10 AM » |
|
So your requirement is receive 3 parameters Source Directory (%1) Destination Directory (%2) Filename (%3)
Copy filename from Source to Destination
The simplest way is (with no error checking)
Copy %1\%3 %2
|
|
|
|
|
sri53 Topic Starter
Posts: 12
|
 |
« Reply #7 on: November 06, 2009, 05:05:52 AM » |
|
Thank you gpl. Its working. I have created a batch file with your command. I have passed three arguments to the file while running it.
Can we copy the file from one machine to other machine?
|
|
|
|
|