Page 1 of 1 1
Topic Options
#65150 - 2002-05-02 03:54 PM determining desktop location
zz_vf_zz Offline
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 Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#65152 - 2002-05-03 06:20 PM Re: determining desktop location
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
zz_vf_zz,

Ping... Did this work for you?

- Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#65153 - 2002-05-05 11:15 AM Re: determining desktop location
zz_vf_zz Offline
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
#65154 - 2002-05-05 03:38 PM Re: determining desktop location
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I'm no fan of roamies (don't allow them) and even less of a fan of Wintendo, so maybe I'm just wasting your time...

Do Wintendos not have an "All Users" desktop as does NT or would that not do? I have seen a lot of posts where on Wintendos, a portion of the KiX script is pushed to the RunOnce key for execution after the logon, when the user hive has loaded.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#65155 - 2002-05-06 10:39 AM Re: determining desktop location
zz_vf_zz Offline
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. Offline
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
#65157 - 2002-05-06 02:49 PM Re: determining desktop location
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Still there's the issue that the user's profile does not load until after the logon. See the FAQ
Sequence of events during logon

If it's just a matter of refreshing the desktop, a reboot is not required. A SetFocus(), SendKeys() is all that's needed.

SetFocus("Program Manager")
SendKeys("{F5}")
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#65158 - 2002-05-07 07:40 AM Re: determining desktop location
zz_vf_zz Offline
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 Offline
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.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#65160 - 2002-05-26 03:31 PM Re: determining desktop location
zz_vf_zz Offline
Getting the hang of it

Registered: 2002-04-07
Posts: 53
I think this will,

Thanks.

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.147 seconds in which 0.112 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org