關於如何將 office word 變成限定Administrator 執行

2015-08-25


上一篇文章 關於如何將Execl 變成限定Administrator 執行 我們用了三個方法讓Excel 執行起來,但是如果你要改word 你會發現 他並沒有 winword.exe.manifest,這時候我們要用點小技巧

1.上篇文章我們不是改過 excel.exe.manifest 的內容,這時候我們複製這檔案變成 winword.exe.manifest 其內容為


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <noInherit></noInherit>
    <assemblyIdentity version="11.0.0.0" processorArchitecture="*" name="excel" type="win32"></assemblyIdentity>
    <description>Microsoft Excel</description>
    <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 7 -->
            <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"></supportedOS>
            <!--This Id value indicates the application supports Windows 8 functionality-->
            <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>
            <!-- This Id value indicates the application supports Windows 8.1 functionality-->
            <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"></supportedOS>
            <!-- This Id value indicates the application supports Windows 10  functionality-->
            <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"></supportedOS>
        </application> 
    </compatibility>
    <asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
        <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
            <dpiAware>true</dpiAware>
        </asmv3:windowsSettings>
    </asmv3:application>
</assembly>

2. 開啟 Developer Command Prompt for VS2015 ,別忘記了記得用系統管理員身分執行

Image 078

3. 切換 到 office 安裝路徑下面 並且下一個指令為


C:\Program Files\Microsoft Office\root\Office16>mt -manifest winword.exe.manifet -outputresource:winword.exe;#1

畫面:
Image 079

這樣執行起來word 就是需要系統管理員身分了。


當麻許的超技八 2014 | Donma Hsu Design.