Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ilya Rabyy
  Where is Ilya Rabyy?
 Fountain Valley
 California - United States
 Ilya Rabyy
 To: Yuri Rubinov
  Where is Yuri Rubinov?
 Philadelphia
 Pennsylvania - United States
 Yuri Rubinov
 Tags
Subject: RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a
Thread ID: 78978 Message ID: 79182 # Views: 2 # Ratings: 0
Version: Visual FoxPro 7 Category: Operating Systems
Date: Thursday, October 13, 2005 5:22:15 PM         
   


> >
> > I'd rather find some way of obtaining the path to the UserProfile folder on NT4 WS programmatically without employing anything from Shell32.DLL version later than 4.00.
> >
> > Could you give me any hints/ideas on that?
> >
> > Regards,
> >
> > Ilya

>
> See if this help:
>
> WshShell = CreateObject("WScript.Shell")
> ?WshShell.SpecialFolders("MyDocuments")
>
>
> Best Wishes,
>
> Yuri Rubinov


Yep, combination of Shell32, GETENV() and WinScript gave the desired result. Here's what I have ended up with:
IF VAL(OS(3)) = 4 && WinNT 4 or Win4.9xx
   loWshShell = CreateObject("WScript.Shell")
   lcBuff = loWshShell.SpecialFolders("MyDocuments")
   
   IF EMPTY(lcBuff) && Still? See if GETENV("USERPROFILE") would help
      lcBuff = GETENV("USERPROFILE")
   ENDIF (EMPTY(lcBuff) && Still? See if GETENV("USERPROFILE") would help)
   
ELSE
   lnRet = SHGetSpecialFolderPath(hScreenWnd, @lcBuff, CSIDL_PERSONAL, 0)
ENDIF (VAL(OS(3)) = 4 && WinNT 4 or Win4.9xx)

My profound thanks to Yuri and Ken!

BTW: Where can I look up the WinScript's documentation? (I ran the search for "Windows Scripting" against July 2001 MSDN Library and - as usual - got absolutely unrelated/uncomprehensible results.)

TIA!

Regards,

Ilya

ENTIRE THREAD

Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Ilya Rabyy @ 10/11/2005 6:50:03 PM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Yuri Rubinov @ 10/11/2005 8:35:00 PM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Ilya Rabyy @ 10/11/2005 9:27:25 PM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Yuri Rubinov @ 10/11/2005 9:46:02 PM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Ilya Rabyy @ 10/11/2005 10:33:30 PM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Ken Murphy @ 10/12/2005 2:16:46 PM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Ilya Rabyy @ 10/12/2005 5:10:18 PM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Ken Murphy @ 10/12/2005 9:23:13 PM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Ilya Rabyy @ 10/12/2005 9:33:01 PM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Ken Murphy @ 10/12/2005 9:54:45 PM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Ilya Rabyy @ 10/13/2005 12:36:47 AM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Ken Murphy @ 10/13/2005 12:38:50 AM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Ilya Rabyy @ 10/13/2005 12:52:43 AM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Yuri Rubinov @ 10/12/2005 2:41:31 PM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Ilya Rabyy @ 10/12/2005 6:22:36 PM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Yuri Rubinov @ 10/12/2005 8:38:25 PM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Ilya Rabyy @ 10/13/2005 12:39:13 AM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Ilya Rabyy @ 10/13/2005 5:22:15 PM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Yuri Rubinov @ 10/13/2005 5:56:08 PM
RE: Probem with VFP7 and Shell DLL on WinNT 4 SP6a Posted by Ilya Rabyy @ 10/13/2005 6:12:37 PM