Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: Tony Vignone
  Where is Tony Vignone?
 St Augustine
 Florida - United States
 Tony Vignone
 Tags
Subject: RE: Any tips for migrating from XP to Win7
Thread ID: 395425 Message ID: 395467 # Views: 54 # Ratings: 2
Version: Visual FoxPro 9 SP2 Category: Windows 7 and VFP
Date: Wednesday, January 15, 2014 9:12:53 AM         
   


> > I am about to upgrade my main development system from XP Pro to Windows 7 pro. Any pearls of wisdom to share?
> >
> > TIA for your help,
> > Margaret
>
> If you migrate any settings, watch for out those that have folders.
> Win 7 doesn't always like "C:\Documents and Settings"
>
> Tony


On the other hand, I'd say that part is easier in Vista/7/8 as well -
in WinXP En/US, there was a folder "C:\Documents and Settings", but not in other localized versions like a French, Italian, Spanish WinXP, same for the %programfiles% folder that had different names.
And in addition, that folder could also have been something like "F:\Documents and Settings" in a multi-boot environment, and parts of its content could and still can be redirected elsewhere by the user.

Whereas in Vista/7/8, "C:\Documents and Settings" does not really exist (because the real name is (always) "C:\Users" now), but the O/S pretends it would (similar to the "Virtual Store" feature)

c = "C:\Documents and Settings"
? DIRECTORY(c, 1) && .T.
* In a German Windows 7, for example, the traditional localized XP name also seems to exist
c = "C:\Dokumente und Einstellungen"
? DIRECTORY(c, 1) && .T.


However, all that hassle of course means that one should use SHGetSpecialFolderPath() in Shell32.DLL anyway instead of hard-coded En/US names, or at least GetEnv() to read the O/S environment variables, doesn't it



Regards
-Stefan


CLEAR

* While you can use WSH:
LOCAL loShell as WScript.Shell
loShell = CREATEOBJECT('WScript.Shell')
? m.loShell.SpecialFolders('Desktop')


* ..., in this case we may not need the WSH wrapper (which might or
* might not be available/enabled on a given machine) -
* we can use the Win API directly in VFP:
#define CSIDL_DESKTOP			0x0000
#define CSIDL_COMMON_PROGRAMS	0X0017
#define CSIDL_COMMON_APPDATA	0x0023
#Define CSIDL_PERSONAL			0x0005

Declare Integer SHGetSpecialFolderPath in Shell32.dll ;
	Long hwndOwner, String @ lpszPath, Integer nFolder, Integer fCreate

Local str
str = SPACE(266)

SHGetSpecialFolderPath(0, @str, CSIDL_DESKTOP, 0)
? Left(str, At(Chr(0), str)-1)

SHGetSpecialFolderPath(0, @str, CSIDL_COMMON_PROGRAMS, 0)
? Left(str, At(Chr(0), str)-1)

SHGetSpecialFolderPath(0, @str, CSIDL_COMMON_APPDATA, 0)
? Left(str, At(Chr(0), str)-1)

SHGetSpecialFolderPath(0, @str, CSIDL_PERSONAL, 0)
? Left(str, At(Chr(0), str)-1)


ENTIRE THREAD

Any tips for migrating from XP to Win7 Posted by Margaret Duddy @ 1/14/2014 8:12:13 PM
RE: Any tips for migrating from XP to Win7 Posted by Ali Koumaiha @ 1/14/2014 8:27:50 PM
RE: Any tips for migrating from XP to Win7 Posted by Margaret Duddy @ 1/14/2014 8:38:26 PM
RE: Any tips for migrating from XP to Win7 Posted by Marcio Souza @ 1/14/2014 8:30:24 PM
RE: Any tips for migrating from XP to Win7 Posted by Margaret Duddy @ 1/14/2014 8:37:59 PM
RE: Any tips for migrating from XP to Win7 Posted by Pete Sass @ 1/14/2014 8:33:24 PM
RE: Any tips for migrating from XP to Win7 Posted by Margaret Duddy @ 1/14/2014 8:37:32 PM
RE: Any tips for migrating from XP to Win7 Posted by Stefan Wuebbe @ 1/14/2014 8:51:58 PM
RE: Any tips for migrating from XP to Win7 Posted by Margaret Duddy @ 1/14/2014 9:09:35 PM
RE: Any tips for migrating from XP to Win7 Posted by Tony Vignone @ 1/14/2014 11:06:39 PM
RE: Any tips for migrating from XP to Win7 Posted by Stefan Wuebbe @ 1/15/2014 9:12:53 AM
RE: Any tips for migrating from XP to Win7 Posted by Tony Vignone @ 1/15/2014 6:00:26 PM
RE: Any tips for migrating from XP to Win7 Posted by Stefan Wuebbe @ 1/15/2014 7:03:00 PM
RE: Any tips for migrating from XP to Win7 Posted by Russell Hill @ 1/15/2014 3:46:59 AM
RE: Any tips for migrating from XP to Win7 Posted by Tore Bleken @ 1/15/2014 9:12:18 AM
RE: Any tips for migrating from XP to Win7 Posted by Russell Hill @ 1/15/2014 11:47:02 AM
RE: Any tips for migrating from XP to Win7 Posted by Tore Bleken @ 1/15/2014 11:58:20 AM
RE: Any tips for migrating from XP to Win7 Posted by Russell Hill @ 1/15/2014 10:53:33 PM
RE: Any tips for migrating from XP to Win7 Posted by Tore Bleken @ 1/16/2014 9:12:38 AM
RE: Any tips for migrating from XP to Win7 Posted by Tony Vignone @ 1/16/2014 12:55:49 AM
RE: Any tips for migrating from XP to Win7 Posted by tom knauf @ 1/16/2014 2:32:13 PM