How do I run a PowerShell script when the computer starts?

前端 未结 15 1193
-上瘾入骨i
-上瘾入骨i 2020-11-30 19:24

I have a PowerShell script that monitors an image folder. I need to find a way to automatically run this script after the computer starts.

I already tried the follow

15条回答
  •  被撕碎了的回忆
    2020-11-30 19:57

    What I do is create a shortcut that I place in shell:startup.

    The shortcut has the following:

    Target: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command "C:\scripts\script.ps1"

    (replacing scripts\scripts.ps1 with what you need)

    Start In: C:\scripts

    (replacing scripts with folder which has your script)

提交回复
热议问题