How To Automatically run a powershell cmd on a specific folder on windows 10 start up after a delay (30s) [SOLVED]

Viewed 56

We are using web project unfinished, and everytime the computer start, we need to go to:

c:/wamp64/www/

In this folder we have a folder "projectname", we have to shift right click , and open powershell windows here.

then we have in the terminal: PS C:\wamp64\www\projectname> (and here we have to write "node server.js") and enter.

This have to be done once wamp is open, this is the reason of the delay.

How can we do that automatically at windows start up after 30s ? that way we won't have to do that every time we reboot a computer.

thank you for your help

1 Answers

I would use the task scheduler for that purpose.

  • Open Task Scheduler by pressing “Windows+R” and then typing “taskschd.msc” in the window that opens. Then take the following steps:
  • Click “Create a task” and enter a name and description for the new task. To run the program with administrator privileges, check the “Run with the highest privileges” box.
  • Switch to the Triggers tab and click the “New…” button. Here you can specify the conditions that trigger the task to be executed. For example, you can have it executed on schedule, at logon, on idle, at startup or whenever a particular event occurs. Task scheduler
  • Choose At log on then set it to run for Any user and set the delay to 30 seconds
  • Navigate to the “Actions” tab, and click “New…”. To schedule the PowerShell script, specify the following parameters:
      Action: Start a program
      Program\script: powershell
      Add arguments (optional): -File [Specify the file path to the script here]

References

How to automate powershell scripts with task scheduler

Related