Windows user's list - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

ebuki
Posts: 13
Joined: Wed Aug 26, 2009 10:26 pm

Windows user's list

Dear Support,

how could I create a listbox on a dialog, which contains the all of users on that Windows? I haven't found any property for this.

Thanks, Edvard
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Windows user's list

Hello,

Here is a sample vbscript that enumerates the users on the local machine:

Code: Select all

Set objNetwork = CreateObject("Wscript.Network")
strComputer = objNetwork.ComputerName
Set colAccounts = GetObject("WinNT://" & strComputer & "")
colAccounts.Filter = Array("user")
For Each objUser In colAccounts
    Wscript.Echo objUser.Name 
Next
Here is a guide on how to dynamically populate ComboBoxes and ListBoxes. It is recommended that you thoroughly read it. There are sample projects attached to the guide, with which you can try integrating the script above to achieve the functionality you desire.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”