New
#1
programmatic way with BAT file determining if elevated command prompt
Is there any programmatic way within a BATch file of determining whether it has been started from an elevated command prompt (run as Administrator) or a normal command prompt?
I note the difference between the Current Directory at start of the BATch file, but wonder if there is a better way.
When in elevated mode I don't get a UAC prompt when using DISKPART.
The UAC prompt only happens when running it in a normal command prompt window.
Are you aware of any command which simultaneously would
If this is the case, unless I can find something to distinguish between elevated command prompts and normal command prompts, then I will have to try the %cd% variable at the start of BATch files, to see whether it is consistent even across user modifications of the command prompt shortcut's Target Directory...
- give a different errorlevel when executed in an elevated command prompt than in a normal command prompt, and
- not produce a UAC prompt in normal mode?
Last edited by Brink; 16 Oct 2010 at 13:48.