| View previous topic :: View next topic |
| Author |
Message |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Mon May 02, 2005 1:19 am Post subject: Getting proper list of users on both NT and 9x OS |
|
|
Hi,
Following the thread of the XP privileges that Serge started, I decided to make a quick app, to retreive a list of the users of the current windows system.
Now, all works ok, but on non english system the ALL USERS will be in the list also and it would be difficult to determine it with code. Anyone knows how I could make the following code work, but without the ALL USERS appear in any language? Basically only the valid users on the windows system...
| Code: | #define function,string
external @path(%0)string.dll
Title Get users
DIALOG CREATE,Get users,-1,0,456,359
DIALOG ADD,LIST,LIST1,67,41,365,234,,,click
DIALOG SHOW
list create,1
if @sysinfo(ISNT)
#NT,200x,XP
%%drive = @path(@windir())Documents and Settings
list filelist,1,%%drive,d
else
#windows 95,98,ME
list filelist,1,@windir()profiles,d
end
list seek,1,0
repeat
%%string = @item(1)
#code needed to NOT retreive the ALL USERS in any language
list add,list1,@string(GetAfter,%%string, "\", LAST)
until @null(@next(1))
:Evloop
wait event
goto @event()
:list1click
goto evloop
:Close
exit |
Complete package attached with the string.dll..
Thanks
| Description: |
|
 Download |
| Filename: |
getusers.zip |
| Filesize: |
91.95 KB |
| Downloaded: |
1280 Time(s) |
|
|
| Back to top |
|
 |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Mon May 02, 2005 2:48 am Post subject: |
|
|
Found an extra info...
This regkey:
HLM,software\microsoft\windows NT\currentversion\profilelist
(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList)
That might be helpful.. getting late.. will continue tomorrow morning..to investigate...
|
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Mon May 02, 2005 5:58 am Post subject: |
|
|
Hi Marty,
I tweaked your script a bit... I've only tested on a Win2k machine, but seem to work for me... Try this:
| Code: | #define function,string
external @path(%0)string.dll
Title Get users
DIALOG CREATE,Get users,-1,0,456,359
DIALOG ADD,LIST,LIST1,67,41,365,234,,,click
DIALOG SHOW
list create,1
list create,2
if @sysinfo(ISNT)
#NT,200x,XP
gosub NTUsers
else
#windows 95,98,ME
gosub "9XUsers"
end
list seek,2,0
repeat
%%string = @item(2)
list add,list1,@string(GetAfter,%%string, "\", LAST)
until @null(@next(2))
:Evloop
wait event
goto @event()
:list1click
info @item(2,@index(list1))
goto evloop
:Close
exit
:NTUsers
%%profiles = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
list regkeys,1,HLM,%%profiles
list seek,1,0
repeat
%%ProfilePath = @regread(HLM,%%profiles\@item(1),ProfileImagePath)
list add,2,%%ProfilePath
until @null(@next(1))
exit
:9XUsers
%%profiles = "SOFTWARE\Microsoft\Windows\CurrentVersion\ProfileList"
list regkeys,1,HLM,%%profiles
list seek,1,0
repeat
%%ProfilePath = @regread(HLM,%%profiles\@item(1),ProfileImagePath)
list add,2,%%ProfilePath
until @null(@next(1))
exit
|
Let me know...
Hooligan
_________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Mon May 02, 2005 5:31 pm Post subject: |
|
|
Thanks a lot Hooligan Works ok so far..
Skit thats also a good solution thanks, but I seem to get all the real users by using Hooligan modification:-) But do I really need them all? Dont think so..
So I guess I will fiddle with both ideas and post something in the source code section when I am done.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|