WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: scotts on February 19, 2015, 07:34:51 AM

Title: wntMemberGrps - Windows 8
Post by: scotts on February 19, 2015, 07:34:51 AM
Hi,

I get Will Extender Error: 564 when using wntMemberGrps in Windows 8. It works fine in Windows 7.

Winbatch 2015A
wwnt34i.dll version 39022

Code:

AddExtender("WWWNT34i.DLL")

;DialogcontrolSet(Handle, 4, 5, ResList)
;DialogControlSet(Handle, 4, 13, "255|0|0")
GoodOS = 0
; user
CurUser = wntUserInfo(0)
DetList = StrCat("USER: ", CurUser)
ResList = ""
;DialogControlSet(Handle, 3, 5, DetList)
message("List", ItemExtract(1, DetList, @TAB))

; pc
PCInfo = WinSysInfo()
CurPC = ItemExtract(1, PCInfo, @TAB)
DetList = StrCat(DetList, @TAB, "PC NAME: ", CurPC)
;DialogControlSet(Handle, 3, 5, DetList)
message("List", ItemExtract(2, DetList, @TAB))

; domain
CurDomain = wntuserInfo(1)
DetList = StrCat(DetList, @TAB, "DOMAIN: ", CurDomain)
;DialogControlSet(Handle, 3, 5, DetList)
message("List", ItemExtract(3, DetList, @TAB))

; security groups
CurGroups = wntMemberGrps("", StrCat(CurDomain, "\", CurUser), @LocalGroup, 1)
CurGroups = StrReplace(CurGroups, @TAB, ",")     ; changed ", " to "," to remove leading space
GroupNum = ItemCount(CurGroups, ",")

Message("Group List", CurGroups)
Title: Re: wntMemberGrps - Windows 8
Post by: scotts on February 19, 2015, 08:07:44 AM
Update:

Tried it with wwwnt34i.dll version 39023 - same result
Title: Re: wntMemberGrps - Windows 8
Post by: scotts on February 19, 2015, 10:01:02 AM
Figured it out. I had to change commands as below:

CurUser = wntGetUser(@DEFAULT) ; changed to accomidate windows 8

IsAdmin = wntMemberGet("","Administrators",CurUser,@LOCALGROUP,0)