#139418 - 2005-05-09 03:43 PM
Re: detect when new user logs on?
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
Quote:
I have no idea if it would work or not, but just to throw it out there...could you add a value to the default users run key?
Yeah, but that'd would run any time and not just for the first one, no?
K,
Here's how I'd solve this :
Code:
dim $LogonList, $aMachines, $_
$LogonList = @scriptdir + "\logonlist.ini" $aMachines = split(readprofilestring($LogonList,@userid,"UserLoggedOnTo"),",")
if ascan($aMachines,@wksta) = -1 "Run your executable here!" ? if not @error ; or whatever it takes to proof successful run if $aMachines[0] redim preserve $aMachines[ubound($aMachines) + 1] endif $aMachines[ubound($aMachines)] = @wksta $_ = writeprofilestring($LogonList,@userid,"UserLoggedOnTo",join($aMachines,",")) endif endif
this will maintain a list of machines any user has logged on to so far and if the current machine doesn't match this list it may execute the thing you need to execute.
hth
_________________________
|
|
Top
|
|
|
|
#139420 - 2005-05-09 03:58 PM
Re: detect when new user logs on?
|
maciep
Korg Regular
   
Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
|
Quote:
Yeah, but that'd would run any time and not just for the first one, no?
I don't know. I'm not sure if that key is only hit when a new profile logs on or anytime someone logs on.
But on a side note, regardless of the solution it should take into account that a profile may be deleted from a machine and hence the setup exe would need to run again next time they log on.
|
|
Top
|
|
|
|
#139423 - 2005-05-09 07:24 PM
Re: detect when new user logs on?
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
A thought just occurred to me.. You could something like the following: Code:
IF READVALUE('HKCU\Software\Microsoft\Office\11.0\Outlook','FirsRunDialog')<>'False' ; -- Do whatever ENDIF
Thanks,
Kent
|
|
Top
|
|
|
|
#139425 - 2005-05-09 10:49 PM
Re: detect when new user logs on?
|
kholm
Korg Regular
   
Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
|
Why not use the HKCU-key in registry: Code:
If ReadValue('HKCU\Software\KiX','ExeIsRun') <> '1' ; Execute Your exe here $RC = WriteValue('HKCU\Software\KiX','ExeIsRun','1','REG_SZ') EndIf
-Erik
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 781 anonymous users online.
|
|
|