Hi all, I just had a quick question regarding the functionality of the SpecialFolders function of WScript.Shell.
In my code I have the pretty standard lines:
Set objWSHShell = CreateObject("WScript.Shell")
SpecialFolderPath = objWSHShell.SpecialFolders(strFolder)
Where strFolder is going to be "Desktop". What I'm expecting is a path to: "C:\Users\Steve\Desktop" but what I'm getting is a path to "C:\Users\Public\Desktop".
Just wondering if this is actually supposed to be the expected behavior and if I just misunderstood the purpose of the function or if something else is occurring. Could this be a case of some environment variables not properly set up? For what it's worth noting I'm running Windows 7.
Any help would be greatly appreciated.
Also a note, I was doing a look around the forums and noticed a different approach to the same problem posted by odin1701 (access-programmers.co.uk/forums/showpost.php?p=628457&postcount=2) where he does the following:
strUserName = Environ("UserName")
strPath = "C:\documents and settings\" & strUserName & "\Desktop"
So worse comes to worst I'll fall back on a similar solution, but I'd still like to know what's going on with this function.
In my code I have the pretty standard lines:
Set objWSHShell = CreateObject("WScript.Shell")
SpecialFolderPath = objWSHShell.SpecialFolders(strFolder)
Where strFolder is going to be "Desktop". What I'm expecting is a path to: "C:\Users\Steve\Desktop" but what I'm getting is a path to "C:\Users\Public\Desktop".
Just wondering if this is actually supposed to be the expected behavior and if I just misunderstood the purpose of the function or if something else is occurring. Could this be a case of some environment variables not properly set up? For what it's worth noting I'm running Windows 7.
Any help would be greatly appreciated.
Also a note, I was doing a look around the forums and noticed a different approach to the same problem posted by odin1701 (access-programmers.co.uk/forums/showpost.php?p=628457&postcount=2) where he does the following:
strUserName = Environ("UserName")
strPath = "C:\documents and settings\" & strUserName & "\Desktop"
So worse comes to worst I'll fall back on a similar solution, but I'd still like to know what's going on with this function.