|
-
Jan 24th, 2010, 08:19 PM
#1
User Accounts List
Does anyone know of an API that allows me to grab a list of all the Users on a PC?
I'm creating a small application that will allow the User to focus just on the logged in account, or all accounts.
If the User selects all accounts, I need to be able to go through all of the Users and access the appropriate directories.
Any information is appreciated.
Thanks
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Jan 26th, 2010, 02:49 AM
#2
Re: User Accounts List
You don't need an API for this...
Hope this helps...
Code:
Option Explicit
'~~> Usage: Create a Form with a Command Button and a ListBox
Private Sub Command1_Click()
Dim users As String, wshShell As Object
Set wshShell = CreateObject("WScript.Shell")
Call wshShell.Run("cmd.exe /C" & "net user > C:\Koolsid.Txt", 0, True)
Open "C:\Koolsid.Txt" For Input As #1
Do Until EOF(1)
Line Input #1, users
List1.AddItem users
Loop
Close #1
Kill "C:\Koolsid.Txt"
End Sub
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
May 7th, 2010, 05:35 PM
#3
Re: User Accounts List
You also dont need to use any external commands like that if you are using .NET (which I think weirddemon will be). Here's something I posted in the codebank a while ago that will do the trick: http://www.vbforums.com/showthread.php?t=590129
-
May 8th, 2010, 01:32 AM
#4
Re: User Accounts List
yeah. I saw that the other day, Chris. I've never used that namespace, so I was surprised it was that easy.
Thanks, Chris
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|