Sn3akyP3t3 0 Posted May 30, 2011 I cannot find a means to identify the path of the OS drive without a degree of sloppiness and in all environments. So far the only two means I know of are like so: 1.) Works so long as the home path resides on the same drive the OS does. Useless to me in my work environment. $dir = @HomeDrive MsgBox(0,"",$dir) 2.) Works for the most part, but really sloppy. Becomes a pain when having to use the path literally in comparisons or when treated as a string for StringCompare() functions since it needs to be sanitized of the workaround addition in the path before use. $dir = @WindowsDir & '\..' FileChangeDir($dir) $dir = @WorkingDir MsgBox(0,"",$dir) Of course FileChangeDir() doesn't need to be used. It just produces quick viewable results to describe my problem. Share this post Link to post Share on other sites
AdmiralAlkex 125 Posted May 30, 2011 What if you grab the first three chars with StringLeft? $sWindowsDir = StringLeft(@WindowsDir, 3) MsgBox(0, "", $sWindowsDir) Gives the same result as your script in half the lines .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Share this post Link to post Share on other sites
Sn3akyP3t3 0 Posted May 31, 2011 What if you grab the first three chars with StringLeft? $sWindowsDir = StringLeft(@WindowsDir, 3) MsgBox(0, "", $sWindowsDir) Gives the same result as your script in half the lines Thanks! Leave it to me to over-analyze the simple stuff! Share this post Link to post Share on other sites
MHz 80 Posted May 31, 2011 (edited) EnvGet() is also handy to know if you want to use values from environmental variables. $systemdrive = EnvGet('SystemDrive') MsgBox(0, '$systemdrive', $systemdrive) Edit: fixed typo Edited May 31, 2011 by MHz Share this post Link to post Share on other sites