Elevated Program Shortcut without UAC Prompt - Create

Page 38 of 51 FirstFirst ... 28363738394048 ... LastLast

  1. Posts : 131
    Windows 7 Home Premium 64bit
       #370

    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 Computer


  2. Posts : 71,960
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #371

    You're most welcome MS. I'm happy to hear that it's working well for you. :)
      My Computer


  3. Posts : 161
    Windows 7 Home Premium 64 bit
       #372

    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 Computer


  4. Posts : 71,960
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #373

    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 Computer


  5. Posts : 161
    Windows 7 Home Premium 64 bit
       #374

    ^ 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 Computer


  6. Posts : 71,960
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #375

    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.
    Last edited by Brink; 09 Sep 2013 at 13:03. Reason: typo
      My Computer


  7. Posts : 161
    Windows 7 Home Premium 64 bit
       #376

    Brink said:
    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."

    Last edited by Brink; 09 Sep 2013 at 13:03. Reason: typo
      My Computer


  8. Posts : 71,960
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #377

      My Computer


  9. Posts : 2
    Windows 7 Home Premium 64 bit
       #378

    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 Computer


  10. Posts : 71,960
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #379

    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 Computer


 
Page 38 of 51 FirstFirst ... 28363738394048 ... LastLast

  Related Discussions
Our Sites
Site Links
About 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 09:03.
Find Us