DECLARE INTEGER GetSystemDirectory IN Win32API ; STRING @cLocation, ; INTEGER nSize LOCAL cLocation, nSize m.cLocation = SPACE(256) m.nSize = GetSystemDirectory(@cLocation, 256) IF nSize > 0 * * Got it - it's the size of the return * cLocation = LEFT(m.cLocation,m.nSize) ELSE * * An error occurred when retrieving the value - return the null string * cLocation = '' ENDIFIf you have the Windows Scripting Host, you can use the Wscript.Shell's SpecialFolders collection to retrieve the system directory, and under NT, there's an environment variable available as well.