CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2008
    Posts
    62

    Unhappy how to start an exe after reboot

    Hi People,

    I created and running one win32 exe.
    I want to let the exe to run after the reboot the system also.So i put the entry in registry under the following path.

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

    In XP, It's working fine and the exe runs after the reboot also. But in the case of Vista and Windows7 it does not. Someone told i have to add manifest file.But i could not get the clue about that.

    Can anyone tell me the solution to resolve this issue.
    Thanks in advance.

    By
    Riyas
    Growing developer

  2. #2
    Join Date
    Aug 2008
    Location
    India
    Posts
    186

    Re: how to start an exe after reboot

    The format of manifest file is as below..

    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    <assembly 
       xmlns="urn:schemas-microsoft-com:asm.v1" 
       manifestVersion="1.0">
    <assemblyIdentity 
        processorArchitecture="*" 
        version="5.1.0.0"
        type="win32"
        name="MyApp.exe"/>
        <description>App_Name</description>
        <dependency>
        <dependentAssembly>
        <assemblyIdentity
             type="win32"
             name="Microsoft.Windows.Common-Controls"
             version="6.0.0.0"
             publicKeyToken="6595b64144ccf1df"
             language="*"
             processorArchitecture="*"/>
        </dependentAssembly>
        </dependency>
    <!-- Identify the application security requirements. -->
    <!-- level can be "asInvoker", "highestAvailable", or "requireAdministrator" -->
       <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
         <security>
         <requestedPrivileges> 
          <requestedExecutionLevel 
              level="highestAvailable"
              uiAccess="false"/>
          </requestedPrivileges>
        </security>
        </trustInfo>
    </assembly>
    I had also used this manifest file in my app... to give XP look to the app... an to run the application as administrator.... but the problem i faced was that even if i add the manifest file to the project... Windows defender always blocks my app when launched on startup...!!!!


    Thanks,

  3. #3
    Join Date
    Oct 2008
    Posts
    62

    Re: how to start an exe after reboot

    Yet it's not working

  4. #4
    Join Date
    Aug 2008
    Location
    India
    Posts
    186

    Re: how to start an exe after reboot

    Did you tried with the UAC turned off in windows vista..???

  5. #5
    Join Date
    Jul 2009
    Posts
    58

    Re: how to start an exe after reboot

    Hi man

    just try to use

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

    instead of

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

    BYe..

  6. #6
    Join Date
    Oct 2008
    Posts
    62

    Unhappy Re: how to start an exe after reboot

    If i use HKCU it's working fine.
    Since i want to let my exe to run under all the users, I want to use HKLM only.
    At the same time , I dont want to switch off the UAC.

    Thanks in advance,
    Riyas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured