forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Getting proper list of users on both NT and 9x OS

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Mon May 02, 2005 1:19 am    Post subject: Getting proper list of users on both NT and 9x OS Reply with quote

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 Smile



getusers.zip
 Description:

Download
 Filename:  getusers.zip
 Filesize:  91.95 KB
 Downloaded:  1281 Time(s)

Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Mon May 02, 2005 2:48 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Mon May 02, 2005 5:58 am    Post subject: Reply with quote

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
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Mon May 02, 2005 10:15 am    Post subject: Reply with quote

Maybe you can do something with this? Just check if this item occures in list1... Smile

Code:
info @env(ALLUSERSPROFILE)

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Mon May 02, 2005 5:31 pm    Post subject: Reply with quote

Thanks a lot Hooligan Smile 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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group