gpt4 book ai didi

windows - 如何让我的程序在 Windows 7 启动时以不同的权限运行?

转载 作者:可可西里 更新时间:2023-11-01 09:56:57 24 4
gpt4 key购买 nike

我试图添加在 Windows 7 启动时运行的程序,但它不起作用。我的程序有一个嵌入式 UAC list 。

我目前的方法是在 HKCU..\Run 添加一个字符串值。

我从 http://social.technet.microsoft.com/Forums/en/w7itprosecurity/thread/81c3c1f2-0169-493a-8f87-d300ea708ecf 找到了 Vista 的手动解决方案

  1. Click Start, right click on Computer and choose “Manage”.
  2. Click “Task Scheduler” on the left panel.
  3. Click “Create Task” on the right panel.
  4. Type a name for the task.
  5. Check “Run with highest privileges”.
  6. Click Actions tab.
  7. Click “New…”.
  8. Browse to the program in the “Program/script” box. Click OK.
  9. On desktop, right click, choose New and click “Shortcut”.
  10. In the box type: schtasks.exe /run /tn TaskName where TaskName is the name of task you put in on the basics tab and click next.
  11. Type a name for the shortcut and click Finish.

Additionally, you need to run the saved scheduled task shortcut to run the program instead of running the application shortcut to ignore the IAC prompt. When startup the system will run the program via the original shortcut. Therefore you need to change the location to run the saved task. Please:

  1. Open Regedit.
  2. Find the entry of the startup item in Registry. It will be stored in one of the following branches.
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    • HKEY_USERS.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Run
    • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
  3. Double-click on the correct key, change the path to the saved scheduled task you created.

是否有任何免费代码可以在计划任务中添加具有特权选项的项目?我在 torry.net 上没有找到免费的。

非常感谢。

最佳答案

有一个名为 TaskScheduler 的 COM 组件。一些文档位于 http://msdn.microsoft.com/en-us/library/aa384006(v=VS.85).aspx . Windows 7 培训工具包中包含一个 C# 示例。

关于windows - 如何让我的程序在 Windows 7 启动时以不同的权限运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2764220/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com