Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何仅使用powershell在引导/登录时运行powershell脚本_Powershell - Fatal编程技术网

如何仅使用powershell在引导/登录时运行powershell脚本

如何仅使用powershell在引导/登录时运行powershell脚本,powershell,Powershell,我尝试了发布在这里的答案: 尝试了50票赞成的解决方案,但没有成功,所以我正在寻找其他替代方案。无论有什么解决方案,都必须能够仅使用powershell命令完成 您是否可以创建一个注册表值,以便在启动时运行它?打开Regedit并导航到: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run 创建一个新的字符串值-根据需要命名它。对于数据,请提供要运行的命令(Powershell.exe命令行)?例如: Key: HK

我尝试了发布在这里的答案:


尝试了50票赞成的解决方案,但没有成功,所以我正在寻找其他替代方案。无论有什么解决方案,都必须能够仅使用powershell命令完成

您是否可以创建一个注册表值,以便在启动时运行它?打开Regedit并导航到:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
创建一个新的字符串值-根据需要命名它。对于数据,请提供要运行的命令(Powershell.exe命令行)?例如:

Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Name: MyPowerShellScript
Data: %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:\Path\To\File.ps1"

在stackoverflow上,“不起作用”被认为有点模糊。请指定出错的地方,并根据需要添加尽可能多的详细信息。“任何解决方案都必须只能使用powershell命令完成。”regedit是gui工具,然后使用powershell编写注册表项!!?如果你想要一个清晰的答案,你需要写一个清晰的问题。很模糊。没有解释你具体尝试了什么。没有理由说明为什么您只能使用PowerShell。