#65150 - 2002-05-02 03:54 PM
determining desktop location
|
zz_vf_zz
Getting the hang of it
Registered: 2002-04-07
Posts: 53
|
Hi, Is it possible to determine the path of the desktop folder in kix?
Thanks
|
|
Top
|
|
|
|
#65151 - 2002-05-02 03:57 PM
Re: determining desktop location
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
zz_vf_zz,
Look for Desktop under -
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
HTH,
- Kent
|
|
Top
|
|
|
|
#65152 - 2002-05-03 06:20 PM
Re: determining desktop location
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
zz_vf_zz,
Ping... Did this work for you?
- Kent
|
|
Top
|
|
|
|
#65153 - 2002-05-05 11:15 AM
Re: determining desktop location
|
zz_vf_zz
Getting the hang of it
Registered: 2002-04-07
Posts: 53
|
Hi, This works fine, in most cases, but if using win95 profiling - there's a problem - this key in the registry is updated to the correct value of the user namespace, only after login process completes, So when I read this value in the login script, it's just c:\windows\desktop, and not c:\windows\profiles\USERNAME\Desktop.
Thanks for your help, V.F.
P.S Is there any way to deal with it? Maybe find out if profiling is enabled?
|
|
Top
|
|
|
|
#65155 - 2002-05-06 10:39 AM
Re: determining desktop location
|
zz_vf_zz
Getting the hang of it
Registered: 2002-04-07
Posts: 53
|
The only problem with this solution is that it works only on the next boot. It's not really nice to boot the user each time.
Thanks, V.F.
|
|
Top
|
|
|
|
#65156 - 2002-05-06 02:40 PM
Re: determining desktop location
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
I pulled this excerpt off of Google Search:
quote:
Each time the user logs on to a computer, Windows 95 searches the Registry under the following key to determine whether the user has a local profile:
Hkey_Local_Machine\Software\Microsoft\Windows\Current Version\Profile List
Windows 95 also checks for the user profile in the user’s home directory on the server. If the user profile on the server is the most current, Windows 95 copies it to the local computer for use during the current session, and then it loads the settings in this local copy into the Registry. If no local user profile exists, Windows 95 copies the server version to the local computer. If no profile is found, Windows 95 creates a new user profile on the local computer using default settings. If the user doesn’t log on, then Windows 95 automatically uses the default user profile. Both the local and network copies of the user profile are automatically updated with current settings when the user logs off. If the user is logged on at more than one computer at the same time, any changes made to the profile on the computer where the user first logs off will be overwritten when the user logs off the other computer. In other words, the last logoff is saved, and no merging of changes occurs.
If you can use a reg search using the @userid macro for the existence of a user profile, then you could search for the desktop path.
|
|
Top
|
|
|
|
#65158 - 2002-05-07 07:40 AM
Re: determining desktop location
|
zz_vf_zz
Getting the hang of it
Registered: 2002-04-07
Posts: 53
|
Thanks, I'll try those out.
V.F.
|
|
Top
|
|
|
|
#65159 - 2002-05-23 07:48 PM
Re: determining desktop location
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,
Solved?
To solve possible problems with W95 systems you can verify the availability of profile we are using following code to calculate desktop location. The benefits of windows 95 is: the user profiles will be there. We are using $desktop_nt, $startup_nt, $desktop_w95 and $startup_w95.
code:
$debug_mode="yes" ; -yes/no - ; IF (@inwin = 1) $NT_mode="yes" ELSE $NT_mode="no" ENDIF
; --------------------------------------------------------------------------
$desktop_nt="c:\winnt\profiles\"+LCASE($user)+"\Desktop" ; IF ($NT_mode = "yes") IF (len(%userprofile%) <> 0) $desktop_nt=LCASE(%userprofile%)+"\Desktop" ENDIF ; IF ($debug_mode = "yes") ? " desktop_nt = "+$desktop_nt ENDIF ENDIF ; $desktop_nt=LCASE($desktop_nt)
$startup_nt="c:\winnt\profiles\"+LCASE($user)+"\Startup" ; IF ($NT_mode = "yes") IF (len(%userprofile%) <> 0) $startup_nt=LCASE(%userprofile%)+"\Startup" ENDIF ; IF ($debug_mode = "yes") ? " startup_nt = "+$startup_nt ENDIF ENDIF ; $startup_nt=LCASE($startup_nt)
; --------------------------------------------------------------------------
$desktop_w95="c:\windows\desktop" IF (exist("c:\windows\profiles\"+LCASE($user)+"\desktop") = 1) $desktop_w95="c:\windows\profiles\"+LCASE($user)+"\desktop" ENDIF ; IF ($NT_mode <> "yes") IF ($debug_mode = "yes") ? " desktop_w95 = "+$desktop_w95 ENDIF ENDIF ; $desktop_w95=LCASE($desktop_w95)
$startup_w95="c:\windows\startup" IF (exist("c:\windows\profiles\"+LCASE($user)+"\startup") = 1) $startup_w95="c:\windows\profiles\"+LCASE($user)+"\startup" ENDIF ; IF ($NT_mode <> "yes") IF ($debug_mode = "yes") ? " startup_w95 = "+$startup_w95 ENDIF ENDIF ; $startup_w95=LCASE($startup_w95)
Of course we prefer the usage of registry values. It replace the NT part. This part looks like:
code:
$ikey="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" IF (ExistKey($ikey) = 0) $desktop_nt=ReadValue($ikey, "Desktop") IF (LEN($desktop_nt) = 0) $desktop_nt="c:\winnt\desktop" IF (exist("c:\winnt\profiles\"+LCASE($user)+"\desktop") = 1) $desktop_nt="c:\winnt\profiles\"+LCASE($user)+"\desktop" ENDIF ENDIF ENDIF
greetings.
|
|
Top
|
|
|
|
#65160 - 2002-05-26 03:31 PM
Re: determining desktop location
|
zz_vf_zz
Getting the hang of it
Registered: 2002-04-07
Posts: 53
|
I think this will,
Thanks.
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|