Hello
Basically I want to write a program in qbasic that will copy the contents of one file thats on my floppy drive and insert it into another file thats on my hard drive. I do not want to overwrite the contents of the file on the hard drive. Is there a way and can someone show me?
Thanks
Nancepa
Copy files from a: to c: drive using qbasic
-
- Veteran
- Posts: 109
- Joined: Thu Feb 10, 2005 12:38 pm
If you use the function SHELL and COPY eg
for more information, use DosBox or command prompt and type COPY /?
Code: Select all
SHELL "COPY A:\file.fil C:\"
-
- Veteran
- Posts: 109
- Joined: Thu Feb 10, 2005 12:38 pm
Re: Copy files from a: to c: drive using qbasic
What do you mean by INSERT IT INTO ANOTHER FILE? If you mean stick it on the front or stick it on the end of the other file, it can easily be done. However, if you really want to insert it in the middle somewhere, then the program can get complicated.nancepa wrote:.....
I want to write a program in qbasic that will copy the contents of one file thats on my floppy drive and insert it into another file thats on my hard drive. I do not want to overwrite the contents of the file on the hard drive.
Ok, let's assume you want to insert it on the end of the other file already on the C: drive, and that the name of this file is CCC and is on the root directory of the C: drive. Let's assume that the file on the A: drive is called AAA and is also on the A:\ directory. This is how you could do it:
SHELL "COPY C:\CCC+A:\AAA /B C:\TEMP"
The /B file tells the COPY utility to treat the data on these files as binary, so it can copy and combine any kind of file.
This puts the combined file into a temportary file called C:\TEMP.
You did not overwrite the CCC file, but if you need to, you can copy TEMP to CCC.
Next time, please be more specific with your specifications.
*****
Re: Copy files from a: to c: drive using qbasic
How can I rule the world using QBasic, a cable internet connection, and half a one-liter of Mountain Dew? (please note that ruling a significant portion of the world is good enough for this exercise)Next time, please be more specific with your specifications.
Daniel "Theophage" Clark
theophage (at) geocities (dot) com
"God used to be my co-pilot, but our plane crashed in the mountains and I had to eat Him..."
theophage (at) geocities (dot) com
"God used to be my co-pilot, but our plane crashed in the mountains and I had to eat Him..."
Re: Thanks
Your very welcome. Glad to hear that you got it to work.nancepa wrote:Thanks moneo, for your input I got it to work just as needed.
Nancepa
Regards,
Edward F. Moneo
*****