How do I check if my C++ program is running with admin privileges?
I did it in this manner for batch
set fold=%random%
mkdir "C:\Windows\%fold%"
if errorlevel 1 (
goto Tag1
)
goto Tag2
But I cannot use the same thing for C++ because I do not know how to transfer value of %random% that is variable 1 to variable 2 that is %fold% and also, I do not know if there is error level for C++.
Can anyone help me in this case or is there any way to check if my program is running with admin privileges?