Some time ago a kind person gave me the following code snippet to find the users on a Windows PC.
<code>
Local lnNormalAccount, cQuery, oResult
#ifndef UF_NORMAL_ACCOUNT
#Define UF_NORMAL_ACCOUNT 0x00000200
#Endif
*!* Clear
strComputer = "."
objWMIService = Getobject("winmgmts:\\"+strComputer+"\root\cimv2")
lnNormalAccount = UF_NORMAL_ACCOUNT
cQuery = Textmerge("select * from win32_useraccount Where AccountType = <<m.lnNormalAccount>> AND Disabled = False")
colItems = objWMIService.ExecQuery(cQuery)
N = 1
For Each objItem In colItems
yname = Transform(Nvl(objItem.Name,''))
yname = Alltrim(yname)
*!* ?yname
Select pcusers
*!* ? oResult.Count
Next
</code>
My problem is:-
Due to 'repairs' on an XP PC I see the following users on the PC named 'TOWER'
All Users.WINDOWS.
All Users
colin
colin.TOWER - I get this user with a rightclick on the Start button.
The 3rd party software has installed under the colin.TOWER path.
The program listed above only gives me
All Users
colin
Has anyone any knowledge of the routine that can modify it to show all of these users?
If I code around it artificially my app may not work on all XP pcs.
I know I could format and reinstall XP on this PC.
Any advice welcome.
Colin
<code>
Local lnNormalAccount, cQuery, oResult
#ifndef UF_NORMAL_ACCOUNT
#Define UF_NORMAL_ACCOUNT 0x00000200
#Endif
*!* Clear
strComputer = "."
objWMIService = Getobject("winmgmts:\\"+strComputer+"\root\cimv2")
lnNormalAccount = UF_NORMAL_ACCOUNT
cQuery = Textmerge("select * from win32_useraccount Where AccountType = <<m.lnNormalAccount>> AND Disabled = False")
colItems = objWMIService.ExecQuery(cQuery)
N = 1
For Each objItem In colItems
yname = Transform(Nvl(objItem.Name,''))
yname = Alltrim(yname)
*!* ?yname
Select pcusers
*!* ? oResult.Count
Next
</code>
My problem is:-
Due to 'repairs' on an XP PC I see the following users on the PC named 'TOWER'
All Users.WINDOWS.
All Users
colin
colin.TOWER - I get this user with a rightclick on the Start button.
The 3rd party software has installed under the colin.TOWER path.
The program listed above only gives me
All Users
colin
Has anyone any knowledge of the routine that can modify it to show all of these users?
If I code around it artificially my app may not work on all XP pcs.
I know I could format and reinstall XP on this PC.
Any advice welcome.
Colin