I need to check whether the user executing the script has administrative privileges on the machine.
I have specified the user executing the script because the script
What about checking for "\\computername\Admin$\system32"?
function IsLoggedInAsAdmin()
isAdmin = false
set shell = CreateObject("WScript.Shell")
computername = WshShell.ExpandEnvironmentStrings("%computername%")
strAdmin = "\\" & computername & "\Admin$\System32"
isAdmin = false
set fso = CreateObject("Scripting.FileSystemObject")
if fso.FolderExists(strAdmin) then
isAdmin = true
end if
IsLoggedInAsAdmin = isAdmin
end function