Triton 0 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 Share this post Link to post Share on other sites
Valik 478 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 Share this post Link to post Share on other sites
emmanuel 0 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) Share this post Link to post Share on other sites
SlimShady 1 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\ ) Share this post Link to post Share on other sites