in reply to How to determine if a user has administrator privileges in Windows environment

sub is_windows_admin { eval { open my $fh, "> C:/windows/system32/perl_check_if_windows_a +dmin" or die; 1; } && 1; } if ( is_windows_admin() ) { # Strut your stuff }
Don't get fancy. Also, /bin/id isn't the best solution. Again, it's better to verify if you have the privileges you need vs. seeing if you're root. Your solution won't work in a sudo environment.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
  • Comment on Re: How to determine if a user has administrator privileges in Windows environment
  • Download Code