简体   繁体   English

在机器启动时运行 Powershell 脚本?

[英]Run Powershell script on machine start?

I have a script that I need to have run every time a certain Windows XP machine boots up.我有一个脚本,每次启动某个 Windows XP 机器时都需要运行该脚本。 I've written it in Powershell, and it works.我已经在 Powershell 中编写了它,并且可以正常工作。 But how do I get it to run when the machine starts?但是如何让它在机器启动时运行呢? Not when I log in, but on machine start.不是在我登录时,而是在机器启动时。

Thank you谢谢

Task Scheduler - Run at Startup任务计划程序 - 在启动时运行

add a new key to the following registry hive.将新密钥添加到以下注册表 hive。 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

if you want the program be executed once only then add it to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce keys in this hive will be deleted after it is executed.如果您希望程序只执行一次,则将其添加到此 hive 中的 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce 键将在执行后被删除。 You can add.你可以加。 at the beginning of the name to force the deletion to happen at the end of the execution.在名称的开头强制删除在执行结束时发生。

The sequence of execution is listed in the following link http://support.microsoft.com/kb/179365执行顺序列于以下链接http://support.microsoft.com/kb/179365

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM