Re: redirection
- From: "Derek" <derekrss@xxxxxxxx>
- Date: 10 Oct 2005 11:47:10 -0700
Certainly. Use the SHELL command. Assuming that you're using QBASIC,
something like the following should work.
-- Begin code -----
OPEN "TheFile.txt" FOR INPUT AS #1
DO WHILE NOT EOF(1)
LINE INPUT #1, F$
SHELL "xcopy " + F$ + " DestFldr"
LOOP
CLOSE #1
SYSTEM
-- End Code -----
It's not every efficient though. A better method might be to get BASIC
to write a batch file from the original text file and SHELL to that.
-- Begin code -----
OPEN "Temp.bat" FOR OUTPUT AS #2
OPEN "TheFile.txt" FOR INPUT AS #1
DO WHILE NOT EOF(1)
LINE INPUT #1, F$
PRINT #2, "xcopy " + F$ + " DestFldr"
LOOP
CLOSE #1
CLOSE #2
SHELL "cmd /c temp.bat"
SYSTEM
-- End Code -----
Warning! I have just thrown those two together as examples. Neither has
been tested so I may have included some silly mistake or typo which
prevents them from working without minor fixes. But on the other hand,
I might not. They are just intended as pointers indicating how to call
DOS programs like "xcopy" from BASIC.
Cheers
Derek
.
- Follow-Ups:
- Re: redirection
- From: wstoffel
- Re: redirection
- References:
- redirection
- From: wstoffel
- redirection
- Prev by Date: redirection
- Next by Date: Re: redirection
- Previous by thread: redirection
- Next by thread: Re: redirection
- Index(es):
Relevant Pages
|