1
Post New Requests Here / IDEA: A script in cmd to tell if the logged in user has admin rights
« on: March 10, 2010, 04:30 AM »
I have used in a script, the technique:-
mkdir \\%computername%\admin$\tester
IF NOT EXIST \\%computername%\admin$\tester\. goto noADMIN
rmdir \\%computername%\admin$\tester
set admin=true
exit /b 0
:noADMIN
set admin=false
exit /b 1
This works for XP and Windows 7 but I do not seem to be able to get it to work in Vista. Any solution that works across all platforms?
I am limited to just command shell, as clients often disable c/wscript and/or powershell.
mkdir \\%computername%\admin$\tester
IF NOT EXIST \\%computername%\admin$\tester\. goto noADMIN
rmdir \\%computername%\admin$\tester
set admin=true
exit /b 0
:noADMIN
set admin=false
exit /b 1
This works for XP and Windows 7 but I do not seem to be able to get it to work in Vista. Any solution that works across all platforms?
I am limited to just command shell, as clients often disable c/wscript and/or powershell.