
Get all user accounts
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
Get all user accounts
Hi, can anyone tell me is there any way to get all the user accounts list in a field which are shown in the welcome screen? Replies most appreciated.......... 

-
- Posts: 344
- Joined: Tue Feb 24, 2009 6:14 pm
- Contact:
Re: Get all user accounts
Can you be specific? If I got it right, you want to get the list of accounts in a computer and list it in a field control. Is that your point? If it is, I cooked up a code below for you. Put it inside a button or anywhere that will be clicked to see how it works.alemrantareq wrote:Hi, can anyone tell me is there any way to get all the user accounts list in a field which are shown in the welcome screen? Replies most appreciated..........
Code: Select all
on mouseUp
local tDirectory,tDocsPath,tUsers
//Backup the current directory first
put the directory into tDirectory
// Put the user profile's path into tDocsPath
put $USERPROFILE into tDocsPath
// Remove the trailing username
set the itemDel to backslash
delete last item of tDocsPath
// Set the current directory to the result and check the folders
set the directory to tDocsPath
put the folders into tUsers
// Filter out the double "." on top of tUsers
filter tUsers without ".."
// Return the previous current directory
set the directory to tDirectory
// Show dialog box.
answer tUsers titled ((the num of lines in tUsers) && "users found!!")
end mouseUp
- Shedo Chung-Hee Surashu
-
- Posts: 344
- Joined: Tue Feb 24, 2009 6:14 pm
- Contact:
Re: Get all user accounts
P.S., I also uploaded the sample script into revOnline. You can get it at: http://revonline2.runrev.com/stack/450/ ... nvironment
-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
Re: Get all user accounts
A Lot of Thanks shadowslash.......It works Great ! But it brings some unnecessary user accounts (i.e. Default User, NetworkService, LocalService). Any idea to avoid them?
-
- Posts: 344
- Joined: Tue Feb 24, 2009 6:14 pm
- Contact:
Re: Get all user accounts
Here's a modified version of my script above in case you don't want Default User, NetworkService and LocalService to show.alemrantareq wrote:A Lot of Thanks shadowslash.......It works Great ! But it brings some unnecessary user accounts (i.e. Default User, NetworkService, LocalService). Any idea to avoid them?
Code: Select all
on mouseUp
local tDirectory,tDocsPath,tUsers,tUnwantedAccounts
//Backup the current directory first
put the directory into tDirectory
// Put the user profile's path into tDocsPath
put $USERPROFILE into tDocsPath
// Remove the trailing username
set the itemDel to backslash
delete last item of tDocsPath
set the itemDel to comma
// Set the current directory to the result and check the folders
set the directory to tDocsPath
put the folders into tUsers
// Filter out the double "." on top of tUsers
filter tUsers without ".."
// Define the unwanted accounts
put "Default User,NetworkService,LocalService" into tUnwantedAccounts
// Filter out the unwanted accounts of tUsers
repeat for each item tAcctName in tUnwantedAccounts
filter tUsers without tAcctName
end repeat
// Return the previous current directory
set the directory to tDirectory
// Show dialog box.
answer tUsers titled ((the num of lines in tUsers) && "users found!!")
end mouseUp
- Shedo Chung-Hee Surashu
-
- Posts: 203
- Joined: Wed Jul 23, 2008 8:46 am
Re: Get all user accounts
Thanks for the Great Workout !!! Cheers shadowslash.....
-
- Posts: 344
- Joined: Tue Feb 24, 2009 6:14 pm
- Contact:
Re: Get all user accounts
Cheers!!alemrantareq wrote:Thanks for the Great Workout !!! Cheers shadowslash.....
