Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. I've written it in Powershell, and it works. But how do I get it to run when the machine starts? Not when I log in, but on machine start.

Thank you

like image 923
Daniel Williams Avatar asked Jan 20 '23 15:01

Daniel Williams


2 Answers

Task Scheduler - Run at Startup

like image 109
mjolinor Avatar answered Jan 31 '23 08:01

mjolinor


add a new key to the following registry hive. 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. 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

like image 34
Tariq Avatar answered Jan 31 '23 08:01

Tariq