Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i'm trying to get administrative permission (without UAC prompt)

What I have tried:

@echo off
goto check_Permissions

:check_Permissions
    
        
     SET "C:\Users\BDAS\Desktop\check_admin=%~dp0"&SET "check_admin=%~dpf0"

     net session >nul 2>nul & if errorlevel 1  check_admin "%~0" %*

    if %errorLevel% == 0 (
        echo Success: Administrative permissions confirmed. > res_txt.txt
    ) else (
        echo Failure: Current permissions inadequate. > res_txt.txt
    )
    
    pause 
Posted
Updated 29-Apr-22 2:09am

And we have already explained to you more than once that you cannot bypass the UAC prompt. It is there for a very good reason, i.e. to prevent illegal access to secure data on your system.
 
Share this answer
 
Comments
OriginalGriff 29-Apr-22 8:12am    
My word but this one is not a quick learner ... :sigh:
Richard MacCutchan 29-Apr-22 8:25am    
Yet another one who thinks that repeating the same question enough times will get the answer he wants.
mahabir das 30-Apr-22 1:50am    
not same it has been improvised
Richard MacCutchan 30-Apr-22 3:30am    
Yes, it is exactly the same.
How many times do we have to tell you the same thing before you understand?

You cannot bypass UAC though C#, PHP, Python, .BAT, Powershell, Adobe PDF, COBOL, assembly code, machine code, OldUncleTomCobly code, or Caesar cypher.
It is built into the operating system as a security mechanism, and just like they don't build jail cells with only three walls, they don't build back doors in that allow you to stroll past the security because it doesn't please you.

Whatever you are trying to do, forget it. You cannot elevate your app without UAC.
 
Share this answer
 
Again, you can NOT get admin permissions or access to anything without the UAC prompt. It's there to prevent you from doing what you're trying to do, and that's get admin level access to something without the users knowledge of it happening.

Just setting a couple of environment variables is not going to get you admin permissions to anything. That's like saying the Pokemon card you're holding should get you access to The White House. That's not going to happen.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900