Click here to Skip to main content
15,890,336 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need someone to help me correct the script below to bypass UAC Consent and execute without prompt?
If Not WScript.Arguments.Named.Exists("elevate") Then
  CreateObject("Shell.Application").ShellExecute WScript.FullName _
    , """" & WScript.ScriptFullName & """ /elevate", "", "runas", 1
  WScript.Quit
End If


What I have tried:

If Not WScript.Arguments.Named.Exists("elevate") Then
  CreateObject("Shell.Application").ShellExecute WScript.FullName _
    , """" & WScript.ScriptFullName & """ /elevate", "", "runas", 0
  WScript.Quit
End If
Posted
Updated 14-Feb-20 13:07pm

You can't bypass UAC - that's the whole point!
If you could bypass UAC then two things would happen:
1) Users wouldn't know that what an app is about to do is potentially dangerous and / or damaging to their system.
2) If you could do it, so could I. And him over there, with the "I write Ransomware" T-shirt. And suddenly, the malware problem takes a whole new prominence and nobodies computers are safe, even if you do exercise proper precautions.

So no - you can't do it. Elevation requires UAC confirmation from the user and cannot be bypassed.
 
Share this answer
 
Quote:
By pass windows UAC consent.

UAC is specially designed to make life of malware programmers harder.
malware is anything not legitimate.
If your software is legitimate, why is it a problem yo ask the user for permission with UAC.
 
Share this answer
 
Alright, thanks for you contribution.
 
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