|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (5 bit)
Join Date: May 2003
Location: scotland
Posts: 18
|
I have this question that I'm not that sure of, I think I now the answer but again not sure.Here we go...
A user wants a batch file which copies all of their files from the C:\FINANCE and C:\DOCUMENTS directories onto a floppy disk and then lists the contents of the floppy disk.Write a batch file to do this. And my answer to the question is.... @ echo off C: cd\ copy C:\Finance\*.*A: copy C:\Documents\*.*A: cd\ cls dir A: hope I have wrote it out write. Thx for any response
|
|
|
|
|
|
#2 |
|
Member (14 bit)
Join Date: Mar 1999
Location: Kelowna, B.C., Canada
Posts: 9,138
|
That works, a couple of redundant lines.
If you want it automated, you need to add a bit though, and be careful of spaces, and using wildcards. I would do it thus: @echo off cd\ a: md Finance md Documents copy c:\finance\*.* a:\finance\*.* copy c:\documents\*.* a:\finance\*.* echo hit any key to list the contents of a:\finance pause cd a:\finanace dir |more echo hit any key to list the contents of a:\documents pause cd a:\documents dir |more echo hit any key to exit pause echo you may now close this window end Last edited by reboot; 05-26-2003 at 04:16 PM. |
|
|
|
|
|
#3 |
|
Member (14 bit)
Premium Member
Join Date: Jan 2002
Location: The Great NorthWest
Posts: 12,594
|
The "|Y" (pipe Y) should be a "/Y" (forward slash Y).
|
|
|
|
|
|
#4 |
|
Member (5 bit)
Join Date: May 2003
Location: scotland
Posts: 18
|
thx m8, so thats 2 examples to make the batch file.thats back to you reboot.
Last edited by neillsmob; 05-26-2003 at 04:34 PM. |
|
|
|
|
|
#5 |
|
Member (14 bit)
Join Date: Mar 1999
Location: Kelowna, B.C., Canada
Posts: 9,138
|
If I remember my DOS commands, the "/y" can be used within a statement, whereas the "|y" is used at the end.
To use /y in the example above, the line would read: copy /y c:\finance\*.* a:\finance\*.* Which is totally redundant anyhow, because of my failing memory, the copy command doesn't require a confirmation! (I was thinking xcopy, not just copy...) Edited above .bat example to reflect this... |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|