|
#1
|
|||
|
|||
|
How can I collect all of the system user names?
On a multiuser system, how can I collect all of the system's user names when my Setup is executed under Administrator permission?
Best Regards |
|
#2
|
||||
|
||||
|
You would have to query the system -- or an easier, less "exact" way would be to look at the documents & settings folder & scan all the 1st level subdirs.
|
|
#3
|
|||
|
|||
|
Quote:
Document & Settings scanning is not practicability, but how should I query the system? Regards |
|
#4
|
||||
|
||||
|
actually scanning folder names in Document & Settings is a good way for getting a list of *real* users. You should ignore stuff like
All Users Default User NetworkService LocalService and the rest of the folder names should correspond to the user profiles existing on the system. This way you'll not get the names of automatically created users such as ASPNET, IUSR_<MachineName>, IWAM__<MachineName> etc. Another way for getting a full list of user names is to redirect the output of the net user command to a text file, like to File.Run a command like net user > C:\users.txt and then parse C:\users.txt to obtain a list of users ----- note that there could be localization issues if you choose to scan the "Documents and Settings" folder. I have no idea whether this folder is named "Documents and Settings" on non-English systems, nor if the names of the folders inside like "All Users" , "NetworkService" etc. are the same on non-English systems - this is something you should check. Last edited by pww; 10-25-2008 at 10:14 AM. |
|
#5
|
||||
|
||||
|
Quote:
There are api's to query the user database; I dont' know them off the top of my head... If the system is part of a network; you can talk to the AD (windows based) or NOS.... In the absence of details, If it were me; I'd scan the directory. |
|
#6
|
||||
|
||||
|
Quote:
I would use something like: %CommonDocumentsFolder% .. "..\.." to get to the "root" of documents & settings; then scan it. That way; if it's different (and would work on vista/xp) you'd be good. Of course, this method assumes you're not supporting win9x. But if you are; net user wont' help you either... |
|
#7
|
|||
|
|||
|
Quote:
Best Regards Last edited by searcher123; 10-25-2008 at 03:59 PM. |
|
#8
|
|||
|
|||
|
For many reasons
The follow is a very simple example: 1. Create a new limited user called "TEST_User" 2. Restart your system and log-in as TEST_User 3. Restart your system again and log-in as a user with Admin permission. 4. Delete the TEST_User account fully (i.e. when the system asked "Do you want to delete TEST_User files", click on Delete Files key). 5. restart your system again and point to Document & Settings dir. What do you see? Yes, TEST_User dir is there , but where is the user? you killed him/her ![]() Best Regards |
|
#9
|
|||
|
|||
|
Quote:
|
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Setup Factory and VS 2005 | vazir786 | Setup Factory 7.0 Discussion | 4 | 01-13-2006 09:47 PM |
| Collect System Informations | Gianni | AutoPlay Media Studio 5.0 | 1 | 01-10-2005 12:30 AM |
| How do I get the exit status of a program? | ahewgill | AutoPlay Media Studio 5.0 | 2 | 07-22-2004 04:46 PM |
| HOWTO: Prompt the User for Confirmation Before Exiting | Support | AutoPlay Media Studio 4.0 Examples | 0 | 10-03-2002 10:50 AM |
| WINDOWS OS LANGUAGE-VARIABLE | dan37_123 | Setup Factory 6.0 | 6 | 03-20-2002 09:48 AM |
All times are GMT -6. The time now is 06:03 PM.









, but where is the user? you killed him/her 
Linear Mode

