Triton Posted July 28, 2004 Posted July 28, 2004 Heres the code: Dim $RAMDRIVE = EnvGet("RamDrv") $CHECKDRV = DriveStatus($RAMDRIVE & "\") MsgBox(0, "CHECKDRV", $CHECKDRV) If $CHECKDRV = "INVALID" Or $CHECKDRV = "NOTREADY" Or $CHECKDRV = "UNKNOWN" Then MsgBox(0, "ERROR", "RamDrv does not exist!") Exit EndIf What happens is this: $RAMDRIVE is set to an empty string because RamDrv variable does not exist and then DriveStatus($RAMDRIVE & "\") returns a "READY" status to and empty string and a \ Why would it return this value? Triton
Valik Posted July 28, 2004 Posted July 28, 2004 (edited) Because \ = C:\, most likely. Open a command window and type cd \ and you'll be moved to C:\. The API behind the scenes could also be using this logic.Edit: Technically, typing \ means to go to the root drive/directory (/ in *nix). In most installations of Windows, this will probably be the C: drive. Edited July 28, 2004 by Valik
emmanuel Posted July 28, 2004 Posted July 28, 2004 (edited) so, why not throw a drive get type in there? Dim $RAMDRIVE = EnvGet("RamDrv") $CHECKDRV = DriveStatus($RAMDRIVE & "\") if DriveGetType($checkdrv) <> "RamDisk" then msgbox(0, "Error", "RamDisk not found" Exit; or something else endif MsgBox(0, "CHECKDRV", $CHECKDRV) If $CHECKDRV = "INVALID" Or $CHECKDRV = "NOTREADY" Or $CHECKDRV = "UNKNOWN" Then MsgBox(0, "ERROR", "RamDrv does not exist!") Exit EndIf Edited July 28, 2004 by emmanuel "I'm not even supposed to be here today!" -Dante (Hicks)
SlimShady Posted July 28, 2004 Posted July 28, 2004 Because \ = C:\, most likely. Open a command window and type cd \ and you'll be moved to C:\. The API behind the scenes could also be using this logic.Edit: Technically, typing \ means to go to the root drive/directory (/ in *nix). In most installations of Windows, this will probably be the C: drive.I'm at work now.I did some small tests.1.- I opened a Run box- entered: \- pressed enterResult: Windows Explorer opened my home directory. In my case H:2.- I opened a command box- made C:\WINNT the current dir- entered: cd \- pressed enterResult: current dir is set to C:(Same thing with cd\ )3.- I opened a command box- made H:\scripts the current dir- entered: cd \- pressed enterResult: current dir is set to H:(Same thing with cd\ )
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now