Qbasicnews.com

Full Version: move a file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
dose anyone no of a easy way to move a file to a new location?
you may want to use a shell command

[syntax="qbasic"]SHELL ""[/syntax]

I'm not sure of the move file command, but if you search for it, you should get it wasily enough

otherwise, just open the file, and create a new file in teh new directory, then copy contents into new file, KILL the old file

Oz~
ok, I got it

[syntax="qbasic"]copy [source] [dest][/syntax]

Code:
INPUT "File To Move: ", $file
INPUT "Destination Folder: ", $dest

SHELL "copy "; $file;" "; $dest

Oz~

[EDIT] This is where I got the stuff, if you want to do more complex things:
http://www.easydos.com/copy.html
Or, you could just use QBs builtin move function.

Code:
NAME "afile.txt", "folder\moved.txt"
Several years ago there was no MOVE command in DOS, and you had to use a move utility. Now, there is a MOVE. Get on the command line, and enter this:
MOVE /?
That will tell you the syntax.
Do a few tests.
Now you're ready to perform a MOVE within your program's SHELL command.
*****
Thanks Oz Z!re and Moneo
No problem, you're welcome.
Ok, hope you get it to work like you want.
*****
notta prob