[HowTo + Q:] Is there 2nd workaround for AutoStart Elevated application in W8-x?

Discussion in 'Windows 8' started by moderate, Feb 23, 2014.

  1. moderate

    moderate MDL Guru

    Aug 31, 2009
    2,649
    2,151
    90
    #1 moderate, Feb 23, 2014
    Last edited by a moderator: Apr 20, 2017
    Hello,

    you are probably familiar with W8-x bug, that if you set this:
    1.jpg
    Or this:
    2.jpg
    (Run As Elevated)
    ...and then you will put the application into for example in:
    Code:
    \ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
    \Users\[USERNAME]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
    ...or into registry RUN keys:
    Code:
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    HKCU\Software\Microsoft\Windows\CurrentVersion\Run
    ...the application will NOT be aurostarted with OS.

    There is workaround to create task with TaskScheduler, activate it with login and set it to run with administrator's rights like this:
    3.jpg

    ...but I have one older PC (W8-0 x32 for father), when the workaround doesn't work (it runs application without administrator's right, when it is autostarted by OS after the login, but it runs same application with administrator's rights (sometimes :)), when task is run by the user manually from Task Scheduler.

    Does anybody know, how to fix it (without OS reinstall of course) or does anybody know 2nd workaround for autostarting elevated applications in W8-x?

    Thanks for any answers.
     
  2. hb860

    hb860 MDL Addicted

    May 7, 2010
    990
    1,780
    30
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. moderate

    moderate MDL Guru

    Aug 31, 2009
    2,649
    2,151
    90
    #3 moderate, Feb 23, 2014
    Last edited: Feb 23, 2014
    (OP)
    SFC is useless and stupid (as nearly always) :)
    In fact I think it is right tool for you...

    A you can see on 3rd screenshot, I already did, but on that PC it doesn't work, it runs app without elevated status... (I wonder if there is some way to debug this issue, did you tested your tool on W8-0 x32 OS?
     
  4. Superfly

    Superfly MDL Expert

    Jan 12, 2010
    1,133
    542
    60
    #4 Superfly, Feb 23, 2014
    Last edited by a moderator: Apr 20, 2017
    Not sure if this will help but here's a vbs test script to auto-elevate...

    Code:
    If Not WScript.Arguments.Named.Exists("elevate") Then
    If Not MsgBox ("Elevate?",vbYesNo,"Elevate") = vbNo Then
      CreateObject("Shell.Application").ShellExecute WScript.FullName,  WScript.ScriptFullName & " /elevate", "", "runas", 1
      WScript.Quit
    End If
    End If
    CreateObject("Shell.Application").ShellExecute "c:\windows\system32\cmd.exe"
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    7,833
    25,574
    240
    #5 abbodi1406, Feb 23, 2014
    Last edited by a moderator: Apr 20, 2017
    How about you add .manifest file to the application to make it always "requireAdministrator"
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="abc" type="win32"></assemblyIdentity>
    <description>abc</description>
    <dependency>
    <dependentAssembly>
    <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
    </dependentAssembly>
    </dependency>
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
    <requestedPrivileges>
    <requestedExecutionLevel level="requireAdministrator" uiAccess="false"></requestedExecutionLevel>
    </requestedPrivileges>
    </security>
    </trustInfo>
    <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> 
    <application>
    <!--The ID below indicates application support for Windows 8 -->
    <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>
    </application> 
    </compatibility>
    </assembly>
     
  6. hb860

    hb860 MDL Addicted

    May 7, 2010
    990
    1,780
    30
    Mate, you are having a deal with triggered event. It is different thing comparing with ElevatedShortcut.
    My tool creates a shortcut which forces the task to run using schtasks.exe /Run /TN ....
    It is really works, I have tried and I am using this way.
    Just try yourself.
    I hope the others in this thread will get some virus or BSOD. Heaven must provide some punishment for weird tips :rolleyes:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    6,674
    10,079
    210
    #7 murphy78, Feb 23, 2014
    Last edited: Feb 23, 2014
    moderate, if you set a reg key to run a program using run or runonce, it will run it with system permissions which are higher than admin.

    Perhaps your reg key is not being formed correctly?
    Usually what I do is manually create the correct reg key, export it to a reg file, then use that reg file as an import.

    Such as:
    regedit /s RunProg.reg

    Then you reboot.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. moderate

    moderate MDL Guru

    Aug 31, 2009
    2,649
    2,151
    90
    #8 moderate, Feb 23, 2014
    Last edited: Feb 23, 2014
    (OP)
    Thanks for tips, pals, I will try those solutions...

    Well, I generated the task via your app, and I just added login trigger and deleted "terminate after three days of running" and "force terminate for timeout" settings, what you left there by your mistake probably.
    (I always wondered, where OpenVPN tray icon left after three days of running...) :)
    It is visible, because your app gives the task the silly name like "elevated_openvpn-gui_nifgvbewnm~ArGOPRMN".
    You don't need activation trigger, because your app is made to run app via shortcut. Your app works on about 10 PCs, but at this one, it doesn't work via trigger or shortcut (in StartUp group)...
     
  9. moderate

    moderate MDL Guru

    Aug 31, 2009
    2,649
    2,151
    90
    #9 moderate, Feb 23, 2014
    Last edited: Feb 23, 2014
    (OP)
    no, it takes long, solves nothing and all custom patches are undone after that :)
     
  10. moderate

    moderate MDL Guru

    Aug 31, 2009
    2,649
    2,151
    90
    there are none :)
     
  11. CorporateRAT

    CorporateRAT MDL Member

    Aug 4, 2012
    244
    44
    10
    Have you tried "runas" command?
     
  12. moderate

    moderate MDL Guru

    Aug 31, 2009
    2,649
    2,151
    90
    #12 moderate, Mar 7, 2014
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Yep, I've tried everything... :)

    I have ended with EnableLUA=0 and all Metro applications killed except Immersive Control Panel:
    Code:
    C:\Windows\explorer.exe shell:AppsFolder\windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel
    Now the OS is working like W7 (but also with ReFS) :)