Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: UDF-GetUserName
#DefineFunction GetUserName() dllname=strcat(dirwindows(1),"Advapi32.DLL") bufsize=100 PTRBB=BinaryAlloc(bufsize) ; allocate a memory buffer of n bytes PTRNAM=BinaryAlloc(4) BinaryPoke4(PTRNAM,0,bufsize) DllCall(dllname, long:"GetUserNameA", lpbinary:PTRBB, lpbinary:PTRNAM) BinaryEODSet(PTRBB,100) ; set the end of username=BinaryPeekStr(PTRBB, 0, 100) BinaryFree(PTRBB) BinaryFree(PTRNAM) return (username) #EndFunction userid=GetUserName() Message("Userid",userid)
Article ID: W15326
File Created: 2002:09:05:13:51:20
Last Updated: 2002:09:05:13:51:20