If you want to run CMD command on startup automatically in Windows 11 or Windows 10, here is how you can do that. It is possible to run almost any command at startup with the help of the Task Scheduler. Here is how you can set things up as per your requirements.
At times, you might want to run a particular command whenever you log into your account. It can be a ping command or anything else. If so, you can follow this guide to learn how you can use the Task Scheduler, the in-built utility, to run any command via Command Prompt on startup on Windows 11 and Windows 10 computers.
How to run CMD command on startup automatically in Windows 11/10
To run CMD command on startup automatically in Windows 11/10, follow these steps:
- Open Task Scheduler on your computer.
- Click the Create Task button.
- Enter the task name and choose Windows 10 from the Configure for menu.
- Go to the Triggers tab and click the New button.
- Choose At startup from the Begin the task menu.
- Click the OK button.
- Go to the Actions tab and click the New button.
- Enter a command in the following format.
- Click the OK button.
- Click the Yes button.
- Click the OK button.
To learn more about these steps, continue reading.
First, you need to open the Task Scheduler on your computer. For that, you can search for task scheduler in the Taskbar search box and click on the individual search result. Then, click on the Create Task button.
Following that, enter the task name and a description in the General tab. Then, expand the Configure for menu and choose the Windows 10 option from the list.
Next, go to the Triggers tab, expand the Begin the task menu and select the At startup option.
Click the OK button, switch to the Actions tab, and click the New button.
Make sure that the Start a program option is selected in the Action menu. If so, enter the desired command in this format:
"C:\Windows\System32\cmd.exe" /k [command]
For your information, you need to enter the /k parameter to define the command. Let’s assume that you want to pin a website. If so, you need to enter this command:
"C:\Windows\System32\cmd.exe" /k ping www.thewindowsclub.com
Once done, click the OK button. It asks you to confirm the command. If a popup appears, click the Yes button to confirm.
Next, click the OK button to save the change. Following that, your command will run on startup automatically whether you use Windows 11 or Windows 10.
That’s all! Hope this guide helped.
Read: Command Prompt cmd.exe keeps popping up on Startup
How do I make Command Prompt run automatically?
There are two ways to make Command Prompt run automatically on Windows 11/10 PC. First, you can add the Command Prompt in the Startup folder on your computer. Second, you can use the Task Scheduler to create a task that will run the Command Prompt on startup. However, if you want to run a CMD command on startup instead of the Command Prompt, you can use the aforementioned guide to get the job done.
Read: How to Run commands of Command Prompt with a Desktop Shortcut
How do I add a Command Prompt to Windows 11/10 startup?
To add Command Prompt to Windows 11/10 Startup, you have multiple options. First, you can use the Startup folder to run it whenever you log in. Second, you can use the Local Group Policy Editor to use the Run these programs at user logon setting to set things up. Third, you can use Task Scheduler to add Command Prompt on startup. Whether you want to run only a Command Prompt or a CMD command, you can use the Task Scheduler to get that done. However, it is not possible with other methods.