FG

Batch script: how to check for admin rights

Fresh3 days ago
Mar 15, 202617478 views
Confidence Score0%
0%

Problem

How do I check if the current batch script has admin rights? I know how to make it call itself with runas but not how to check for admin rights. The only solutions I've seen are crude hack jobs.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Batch script: how to check for admin rights

Low Risk

You could always do something like this Not the best of ways but works for me all the time.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment