从提升的提示运行未提升的命令?

lag*_*lex 7 windows elevation cmd.exe elevated

是否可以从提升的权限运行的批处理文件中运行没有提升权限的命令?

lag*_*lex 6

这似乎有效。

runas /trustlevel:0x20000 <program>
Run Code Online (Sandbox Code Playgroud)

(海拔特权可以在一个批处理文件进行测试像这样的

我从runas /?它说的地方得到了提示

/showtrustlevels  displays the trust levels that can be used as arguments 
                   to /trustlevel.
/trustlevel       <Level> should be one of levels enumerated 
                   in /showtrustlevels.
Run Code Online (Sandbox Code Playgroud)

runas /showtrustlevels 产出

The following trust levels are available on your system:
0x20000 (Basic User)
Run Code Online (Sandbox Code Playgroud)

我没有任何更深入的了解,但它似乎可以完成这项工作。


好吧,事实证明这引起了问题,至少对我而言。
我的目的是启动 Chrome,但所有页面都崩溃并且无法加载。
另一个问题是我无法将项目拖放到以这种方式和正常方式启动的应用程序之间。


任务计划程序是另一种方式。它不会导致上述问题。尽管您必须提前创建特定任务。


g.p*_*dou 5

我已经尝试过explorer <full path to command to execute>并且有效。

我的想法是:之前我曾尝试运行explorer提升和提升提示但没有成功。此外,当我尝试创建 的快捷方式时explorer,“以管理员身份运行”呈灰色。

我认为现在是时候将探索者的行为转化为利益了。

  • 当您执行“explorer path”时,并且任何“explorer”进程已经在运行,新实例仅要求现有进程在新窗口中打开路径并退出。由于您始终运行一个未提升的“资源管理器”进程(桌面),这实际上意味着“资源管理器路径”会导致未提升的窗口。实际上,如果没有现有的“explorer”进程(您已经杀死了桌面)并且“explorer”已启动提升,则提升的“explorer”将启动未提升的“explorer”并退出。您基本上不会有更多并行运行的“explorer”实例。 (2认同)