无忧启动论坛

标题: 我想试着把绿色版的office2007搞成在UAC下也能用普通权限正常运行的款式 [打印本页]

作者: 求道者    时间: 2017-9-29 12:08
标题: 我想试着把绿色版的office2007搞成在UAC下也能用普通权限正常运行的款式

貌似原版office是可以用普通权限启动的……
作者: tt911    时间: 2017-9-29 12:42
最近几年出的程序一个比一个恶心,真的很难搞成超纯净,免安装,无垃圾进程和服务的啦,还是死心吧。
作者: 9zhmke    时间: 2017-10-15 11:28
本帖最后由 9zhmke 于 2017-10-15 11:29 编辑

试试加管理员的勾行不行,我15年写过方法

       很早前曾经改制过一份42M的OFFICE2007精简版,链接:http://pan.baidu.com/s/1sj9PKq5 ;  因为一直使用自编的优化程序对自己使用的系统进行优化,居然没有测试用普通用户账号登录后的效果。昨天得到微风吐蛋刚精简出来的WIN10,心急安装测试,才发现自编的优化程序无法正常运行,再使用OFFICE精简版时,居然能安装却需要权限才正常运行,必须要对快捷方式点右键选“以管理员身份运行”才可以,这怎么行呢,当下规划了一块时间来跟踪准备解决这个问题。

       之前对快捷方式进行过跟踪,知道兼容性方式仅仅是在注册表里面做了个标记,在注册表中的位置如下(经测试xp/win7/win8/win10及32/64位均相同)
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"全路径执行文件全名"="~ WINXPSP2"

       由于有了以上的经验,这次开起procmon就去记录在快捷里开启管理账号的操作,结果从注册表里却根本查不出来,太奇怪了,等我忙乎了两个多小时才醒悟过来:会不会没记在注册表里面呢?通过十六进查看,原来居然那么简单啊,管理员权限在快捷方式.lnk文件里面的十六进制偏移量15的位置,取出后加上hex(20),写入原文件,成功!

    于是自己用VBS做了个生成带管理员权限快捷方式文件的Function如下:
Function Shortcut(Short_name,path_and_name)
    strDesktop = WshShell.SpecialFolders("AllUsersDesktop")
    set oShellLink = WshShell.CreateShortcut(strDesktop & "\_" & Short_name & ".lnk")
    oShellLink.TargetPath = path_and_name
    oShellLink.WindowStyle = 1
    oShellLink.Hotkey = ""      
    oShellLink.IconLocation = path_and_name & ",0"
    oShellLink.Description = Short_name
    oShellLink.WorkingDirectory = left(path_and_name,InStrRev(path_and_name,"\"))
    oShellLink.Arguments = ""
    oShellLink.Save
    set tmp1=createobject("adodb.stream"):tmp1.type=1:tmp1.open
    tmp1.loadfromfile strDesktop & "\_" & Short_name & ".lnk"
    line=tmp1.read:line=midb(line,1,21) & chr(int(ascb(midb(line,22,1)))+32) & midb(line,24,32766)
    if objFSO.FileExists(strDesktop & "\" & Short_name & ".lnk") then objFSO.deletefile strDesktop & "\" & Short_name & ".lnk",true
    tmp1.close:Set tmp2 = CreateObject("ADODB.Stream"):tmp2.Type=1:tmp2.Open
    With CreateObject("ADODB.Stream")
      .Type=2:.Open:.WriteText line
      .Position=2:.CopyTo tmp2:.Close
    End With
    tmp2.SaveToFile strDesktop & "\" & Short_name & ".lnk",2:tmp2.Close
    objFSO.deletefile strDesktop & "\_" & Short_name & ".lnk",true
End Function

作者: jarryson    时间: 2017-11-3 21:39
论坛里面的好几个版本都可以不用管理员权限启动啊。
作者: tomggx    时间: 2024-12-23 22:38
本帖最后由 tomggx 于 2024-12-23 22:42 编辑

我把 9zhmke 的代码补充完整一下,可以在桌面创建word/excel/powerpoint快捷方式:
Function Shortcut(Short_name,path_and_name)
    Dim wshShell, objFSO
    Set wshShell = Wscript.CreateObject("Wscript.Shell")
    Set objFSO =  Wscript.CreateObject("Scripting.FileSystemObject")
    strDesktop = WshShell.SpecialFolders("AllUsersDesktop")
    set oShellLink = WshShell.CreateShortcut(strDesktop & "\_" & Short_name & ".lnk")
    oShellLink.TargetPath = path_and_name
    oShellLink.WindowStyle = 1
    oShellLink.Hotkey = ""      
    oShellLink.IconLocation = path_and_name & ",0"
    oShellLink.Description = Short_name
    oShellLink.WorkingDirectory = left(path_and_name,InStrRev(path_and_name,"\"))
    oShellLink.Arguments = ""
    oShellLink.Save
    set tmp1=createobject("adodb.stream"):tmp1.type=1:tmp1.open
    tmp1.loadfromfile strDesktop & "\_" & Short_name & ".lnk"
    line=tmp1.read:line=midb(line,1,21) & chr(int(ascb(midb(line,22,1)))+32) & midb(line,24,32766)
    if objFSO.FileExists(strDesktop & "\" & Short_name & ".lnk") then objFSO.deletefile strDesktop & "\" & Short_name & ".lnk",true
    tmp1.close:Set tmp2 = CreateObject("ADODB.Stream"):tmp2.Type=1:tmp2.Open
    With CreateObject("ADODB.Stream")
      .Type=2:.Open:.WriteText line
      .Position=2:.CopyTo tmp2:.Close
    End With
    tmp2.SaveToFile strDesktop & "\" & Short_name & ".lnk",2:tmp2.Close
    objFSO.deletefile strDesktop & "\_" & Short_name & ".lnk",true
End Function

Dim ret
ret = Shortcut("Word", "C:\Program Files (x86)\Office 2016\Office16\WINWORD.EXE")
ret = Shortcut("PowerPoint", "C:\Program Files (x86)\Office 2016\Office16\POWERPNT.EXE")
ret = Shortcut("Excel", "C:\Program Files (x86)\Office 2016\Office16\EXCEL.EXE")




欢迎光临 无忧启动论坛 (http://bbs.c3.wuyou.net/) Powered by Discuz! X3.3