change drives

BlitzMax Forums/BlitzMax Programming/change drives

Jesse(Posted 2008) [#1]
does anybody know or have an idea on how to change drives.
I know how to access and change directories from with in a bmax created executable.
There is some code in the archives that gives information about available drives:
http://www.blitzbasic.com/codearcs/codearcs.php?code=1973

but how do you change drives(like c:,d: etc.)?


Yan(Posted 2008) [#2]
??


Jesse(Posted 2008) [#3]
you use change "changedir" to change dir.
how do you change drives?


plash(Posted 2008) [#4]
To change the current directory use:
ChangeDir "C:\"
ChangeDir "D:\"


EDIT: Or if you want the same path on a different drive you could look for "C:\" and replace it with "D:\".
Print "C:\WINDOWS\".Replace("C:\", "D:\")



Jesse(Posted 2008) [#5]
I would have never guessed it or tryed it if I had not seen it.

Thanks Plash


plash(Posted 2008) [#6]
If your at a path already (you can check what path your at by using CurrentDir(), it should be set to AppDir by default) and you use ChangeDir "<DriveLetter>:\" the current directory will be set to "<DriveLetter>:\", instead of effectively 'changing the drive'. Use the code in my edit if you really need to change the drive.


Jesse(Posted 2008) [#7]
I have all that figured out, if you check my file requester on my previous thread, you can see I have all that figured out except the just mentioned. It's all clear now.
Thanks.