Forcing an application to Admin from config file

前端 未结 1 567
走了就别回头了
走了就别回头了 2020-12-18 14:44

Is there a way I can add a setting in the configuration file so that that application will always start as admin? Thanks a lot.

相关标签:
1条回答
  • 2020-12-18 15:17

    Not from the config file, but in the .manifest.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
            <security>
                <requestedPrivileges>
                    <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
                </requestedPrivileges>
            </security>
        </trustInfo>
    </assembly>
    

    http://blogs.msdn.com/b/nikhiln/archive/2007/04/19/embed-a-manifest-to-make-an-application-elevate-in-vista.aspx

    0 讨论(0)
提交回复
热议问题