Indigo Rose Software

Go Back   Indigo Rose Software Forums > Setup Factory 8.0 > Setup Factory 8.0 Discussion

Reply
 
Thread Tools Display Modes
  #1  
Old 10-24-2008
searcher123 searcher123 is offline
Forum Member
 
Join Date: Jun 2007
Posts: 59
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
Reply With Quote
  #2  
Old 10-24-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,899
Quote:
Originally Posted by searcher123 View Post
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
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.
__________________
Reply With Quote
  #3  
Old 10-25-2008
searcher123 searcher123 is offline
Forum Member
 
Join Date: Jun 2007
Posts: 59
Quote:
Originally Posted by jassing View Post
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.
Thanks to answer Jassing,
Document & Settings scanning is not practicability, but how should I query the system?

Regards
Reply With Quote
  #4  
Old 10-25-2008
pww's Avatar
pww pww is offline
Forum Member
 
Join Date: Jun 2005
Posts: 343
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.
Reply With Quote
  #5  
Old 10-25-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,899
Quote:
Originally Posted by searcher123 View Post
Thanks to answer Jassing,
Document & Settings scanning is not practicability, but how should I query the system?

Regards
Why is it not practical?
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.
__________________
Reply With Quote
  #6  
Old 10-25-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,899
Quote:
Originally Posted by pww View Post
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.


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...
__________________
Reply With Quote
  #7  
Old 10-25-2008
searcher123 searcher123 is offline
Forum Member
 
Join Date: Jun 2007
Posts: 59
Quote:
Originally Posted by pww View Post
(...)Another way for getting a full list of user names is to redirect the output of the net user (...)
Thanks for your suggestion. If I don't find any better solution way, I will use Net User indubitable.

Best Regards

Last edited by searcher123; 10-25-2008 at 03:59 PM.
Reply With Quote
  #8  
Old 10-25-2008
searcher123 searcher123 is offline
Forum Member
 
Join Date: Jun 2007
Posts: 59
Quote:
Originally Posted by jassing View Post
Why is it not practical?(...)
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
Reply With Quote
  #9  
Old 10-26-2008
ShadowUK ShadowUK is offline
Forum Member
 
Join Date: Oct 2007
Location: London, UK
Posts: 1,275
Quote:
Originally Posted by searcher123 View Post
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
Or if you rename it, The folder is still called the old name.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


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.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software