I would like to check whether the context in which my VBscript runs allows me to perform administrative tasks.
Requirements:
The code above that requires "whoami" is from our IfUserPerms script at CSI-Windows.com/toolkit/ifuserperms.
After reading your post here, I have created new script code that checks for admin rights with fast, small, efficient, passive (no changing anything) code in both VBS (9 Lines) and CMD/BAT (3 lines). It also works with UAC by reporting false if the user is not elevated.
You can find the code here: http://csi-windows.com/toolkit/csi-isadmin