Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Elevated Program Shortcut without UAC Prompt - Create

03 Sep 2013   #370
MissSherlock

Windows 7 Home Premium 64bit
 
 

Hi Brink,

Hope all is well in Texas!

I created a start-up rule under the Task Scheduler. Now my programme, so far, is starting when I re-boot the computer.

Thanks so much for all your excellent Tutorials.

ms


My System SpecsSystem Spec
.
03 Sep 2013   #371
Brink

64-bit Windows 10 Pro
 
 

You're most welcome MS. I'm happy to hear that it's working well for you.
My System SpecsSystem Spec
09 Sep 2013   #372
Scoop

Windows 7 Home Premium 64 bit
 
 

Shawn,

I was about to toss in the towel when I saw the Seven Forum as a google search result for what I was wanting to do with launching a bat file.

I followed your tutorial and thought I had everything done correctly. I tried using the shortcut and it didn't work so I thought this wouldn't work with CMD and a .bat file.

After looking my setup over a couple of times, I found my error. I didn't have the path enclosed in quotes for the "location" field in the shortcut

Once the quotes were added, it works great

I have somewhat of an off-topic question but it relates somewhat to the way that I'm using this UAC bypass shortcut.

I'm using this procedure to launch a .bat file which disables the "hibernate" option within "Powercfg".

Here's my .bat script:

Code:
 
@echo off
:: Get ADMIN Privs
:-------------------------------------
mkdir "%windir%\BatchGotAdmin"
if '%errorlevel%' == '0' (
  rmdir "%windir%\BatchGotAdmin" & goto gotAdmin 
) else ( goto UACPrompt )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute %0, "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
  pushd "%CD%"      
  CD /D "%~dp0"
:-------------------------------------
:: End Get ADMIN Privs
@echo on
powercfg -hibernate off
@echo off
timeout /t 5
This works great as it allows me to launch the .bat file and set the user as Admin within it but I realized that I don't need that part in the script as your Task Scheduler launch will do the same thing, temporarily disabling the UAC prompt for this .bat launch.

The question that I have about this is related to the query in powercfg.

After I run the .bat file, I don't see a change in the query info, ie when I'm in the CMD window and I enter

powercfg /query

I look at the return info but I don't see any value that has changed after I previously ran the .bat file which disables the "hibernate" option.

However, I know it's working as I see the change in

Control Panel/Power Options/Change When the Computer Sleeps/Change Advanced Power Settings/Sleep

When I expand the "sleep" tree within Power Options, I can see the "Allow Hybrid Sleep" option appear and then disappear, depending on the "hibernate on/off" command entry in CMD.

I found it interesting that I don't see a status change when querying Powercfg in CMD.

I don't use Hybrid Sleep mode since I prefer a faster Sleep launch and I always close all my activity before putting my PC in Standby.

You're sure right about the UAC being the last line of defense. That's why I don't run my PC with the UAC disabled for everything. I recall when a couple of malware intrusions made it past my AV. I knew immediately due to the UAC prompt appearing suddenly on my screen.
My System SpecsSystem Spec
09 Sep 2013   #373
Brink

64-bit Windows 10 Pro
 
 

That's great news Scoop.

A query will only show you what your current power plan settings are set as. It will not tell you if you have hibernate enable or disabled though.

If you like use the command below to have the query saved as a .txt file on your desktop to read the full query from instead.

powercfg /query > "%UserProfile%\Desktop\query.txt"


Code:
Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c  (High performance).....
 
 Power Setting GUID: 94ac6d29-73ce-41a6-809f-6363ba21b47e  (Allow hybrid sleep)
 GUID Alias: HYBRIDSLEEP
      Possible Setting Index: 000
      Possible Setting Friendly Name: Off
      Possible Setting Index: 001
      Possible Setting Friendly Name: On
    Current AC Power Setting Index: 0x00000000
    Current DC Power Setting Index: 0x00000000
    
 Power Setting GUID: 9d7815a6-7ee4-497e-8888-515a05f02364  (Hibernate after)
 GUID Alias: HIBERNATEIDLE
      Minimum Possible Setting: 0x00000000
      Maximum Possible Setting: 0xffffffff
      Possible Settings increment: 0x00000001
      Possible Settings units: Seconds
    Current AC Power Setting Index: 0x00000000
    Current DC Power Setting Index: 0x00000000
My System SpecsSystem Spec
.

09 Sep 2013   #374
Scoop

Windows 7 Home Premium 64 bit
 
 

^ Thanks for the info

I saved 2 notepad files, one with hibernate on, and the other with hibernate off.

They're identical but the command is working great as I see the verification within Control Panel and I also see the difference when I put the PC into Sleep (hibernate on, the HDD is saving environment and off, HDD activity almost instantaneous before system Standby is launched).

Weird. I guess the bottom line is what counts. It's working good, just strange that I don't see the status change in the query data.

I do notice something that may be related to this.

I'm running "balanced" power mode, with the Registry Key power plan as:

381b4222-f694-41f0-9685-ff5bb260df2e

However, in the query output notepad files, I don't see that key included in the query data. Instead, here's what's in my query output files:

Power Setting GUID: 94ac6d29-73ce-41a6-809f-6363ba21b47e (Allow hybrid sleep)
Possible Setting Index: 000
Possible Setting Friendly Name: Off
Possible Setting Index: 001
Possible Setting Friendly Name: On
Current AC Power Setting Index: 0x00000001
Current DC Power Setting Index: 0x00000001
Power Setting GUID: 9d7815a6-7ee4-497e-8888-515a05f02364 (Hibernate after)
Minimum Possible Setting: 0x00000000
Maximum Possible Setting: 0xffffffff
Possible Settings increment: 0x00000001
Possible Settings units: Seconds
Current AC Power Setting Index: 0x00000000
Current DC Power Setting Index: 0x00000000

I don't know if that's the reason I'm not seeing a change in the query data when I change the Hibernate state in CMD.

[edit] I missed your first line in your earlier reply, that powercfg won't show whether Hibernate is enabled or disabled. I guess that's why I won't see it toggle in the query data.
My System SpecsSystem Spec
09 Sep 2013   #375
Brink

64-bit Windows 10 Pro
 
 

Yeppers. The query only shows what your current power plan settings are.

If you were to say set hibernate to Never vs X amount of minutes, then you would see that change in the query after each time.
My System SpecsSystem Spec
09 Sep 2013   #376
Scoop

Windows 7 Home Premium 64 bit
 
 

Quote   Quote: Originally Posted by Brink View Post
Yeppers. The query only shows what your current power plan settings are.

If you were to say set hibernate to Never vs X amount of minutes, then you would see that change in the query after each time.
I see now. Thanks again

I just added a shortcut for MBAM (Malwarebytes). This is perfect for those handful of apps & other utilities that we launch several times daily.

I just want to say....

"We hereby decree that the tutorials at the Windows 7 Forum be awarded first prize for the best user-friendly concise instructions in cyberspace. So let it be ordained on this day, the 9th of September 2013 A.D. 11:35am UTC"

"Ayes?"

"Nays"?

"Motion unanimously carried."

My System SpecsSystem Spec
09 Sep 2013   #377
Brink

64-bit Windows 10 Pro
 
 

My System SpecsSystem Spec
24 Sep 2013   #378
elromo

Windows 7 Home Premium 64 bit
 
 

Thank you for this forum. After 8 yrs I finally got a new computer running Windows 7 (previously XP) & have had nothing but problems since. I have resolved one of the problems thanks to this forum. I would like to know if it is possible to resolve the UAC box issue in Documents. I downloaded OpenOffice & was able to follow your instructions so that when I open OpenOffice from the newly created shortcut, the UAC box does not open. However, once I create a document in OpenOffice and it goes to the Documents library, when I try to open it I get the UAC box. Is there a way around this?
My System SpecsSystem Spec
24 Sep 2013   #379
Brink

64-bit Windows 10 Pro
 
 

Hello Elromo, and welcome to Seven Forums.

The issue is that when you open the file it's set to open the .exe of OpenOffice instead of the elevated shortcut. If you like, you should be able to right click on the document to use Open with to select to always open those type of files with the elevated shortcut.

Open With - Change Default Program

Hope this helps,
Shawn
My System SpecsSystem Spec
Reply

 Elevated Program Shortcut without UAC Prompt - Create




Thread Tools




Similar help and support threads
Thread Forum
Elevated Program Shortcut - Create for Standard User
How to Create an Elevated Program Shortcut Any User is able to Run in Vista, Windows 7, and Windows 8 This will show you how to create an elevated program shortcut that allows any user (ex: Standard user) to be able to run a program that runs as administrator without being prompted to enter the...
Tutorials
Elevated Command Prompt Shortcut
How to Create an "Elevated Command Prompt" Shortcut in Windows 7 and Windows 8 This tutorial will show you how to create a shortcut that will open an elevated command prompt with administrator rights in Windows 7 and Windows 8. When you use the elevated command prompt shortcut, you may be...
Tutorials
Task Manager - Create Elevated Shortcut
How to Create an Elevated Task Manager Shortcut in Windows 7 This will show you how to create a elevated Task Manager shortcut that will "run as an administrator" in Windows 7 when opened. It will open as if you clicked Show processes from all users in the default Task Manager. You will...
Tutorials
Setting Priority with "Elevated Shortcut without UAC Prompt Tutorial"
I used the info in Elevated Program Shortcut without UAC Prompt Tutorial and it soon dawned on me that the applications seemed to be taking a long time to run. Than the penny dropped - Scheduled Tasks run at priority 7 by default (which is lower than directly run applications typically run at)...
General Discussion
Creating an Elevated Program Shortcut for Search Everything Program.
I`ve done this successfully for SpeedFan, but I`m having a problem with doing the same for the Search Everything program. I`ve been through the tutorial steps several times now, the task executes successfully,( I checked it with command prompt box) but nothing happens. /c start "SpeedFan"...
Software
Question on "How to Create a Elevated Program Shortcut ..."
The solution (Shawn) in the thread How to Create a Elevated Program Shortcut without a UAC Prompt (https://www.sevenforums.com/tutorials/11949-elevated-program-shortcut-without-uac-prompt-create.html) ends with 24. When you run this new elevated shortcut, you will now no longer have...
System Security


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 16:15.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App