>>>>>>CAn anyone show me a sample to code to get the system directory??
>>>>>>
>>>>>>Thanks godzillion :)
>>>>>
>>>>>Gan,
>>>>>
>>>>>I don't know if you had a problem with getting this to work because of using information in the API section. Unfortunately, it's not correct, and there's no way for me to correct it. It shows
lcBuffer = SPACE(255)
>>>>>DECLARE INTEGER GetSystemDirectory IN WIN32API STRING, INTEGER
>>>>>lnNameLength = GetSystemDirectory(@lcBuffer, 255)
>>>>>lcSystemDir = LEFT(lcBuffer, lnNameLength-1)
>>>>>* Should be
>>>>>DECLARE INTEGER GetSystemDirectory IN WIN32API STRING @, INTEGER
>>>>>lcbuffer = SPACE(260)
>>>>>lnNameLength = GetSystemDirectory(@lcBuffer, 260)
>>>>>lcSystemDir = LEFT(lcBuffer, lnNameLength)
The value returned does
not include the terminating null character.
>>>>
>>>>Hi George,
>>>>
>>>>Your code works fine. This code gives me data type mismatch error:
>>>>
>>>>oReg=createobject('Scripting.FileSystemObject')
>>>>? oReg.GetSpecialFolder(0)
>>>>
>>>>
>>>>What could be wrong?
>>>
>>>It returns a folder object reference not a string. Off the top of my head
oFolder = oReg.GetSpecialFolder(1)
>>>? oFolder.Path
>>>? oFolder.Name
>>
>>Great, thanks a lot. I misundesrtood the Help...
>
>The current help file indicates that it's a Folder Object, but the
Window Script Programmers Reference indicates it returns a string. Ed and I noted the latter in the latest in our VFUG series of articles on the FileSystemObject.
Hi George,
May be I'm asking too much, but is it possible to also publish all your articles together here in UT articles section? The reason, I'm asking, is that it's a little inconvenient to find and print these articles from VFUG. At least, I have to check couple issues and it prints the whole page, not only the article I want...
If it's not broken, fix it until it is.
My Blog