How to run CMD command on startup automatically in Windows 11/10

How to run CMD command on startup automatically in Windows 11/10


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:

  1. Open Task Scheduler on your computer.
  2. Click the Create Task button.
  3. Enter the task name and choose Windows 10 from the Configure for menu.
  4. Go to the Triggers tab and click the New button.
  5. Choose At startup from the Begin the task menu.
  6. Click the OK button.
  7. Go to the Actions tab and click the New button.
  8. Enter a command in the following format.
  9. Click the OK button.
  10. Click the Yes button.
  11. 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.

How to run CMD command on startup automatically in Windows 11/10

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.

How to run CMD command on startup automatically in Windows 11/10

Next, go to the Triggers tab, expand the Begin the task menu and select the At startup option.

How to run CMD command on startup automatically in Windows 11/10

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:WindowsSystem32cmd.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:WindowsSystem32cmd.exe" /k ping www.thewindowsclub.com

How to run CMD command on startup automatically in Windows 11/10

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.

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.

Read: Disable Startup programs in Windows using Task Manager, WMIC, GPEDIT, Task Scheduler, MSCONFIG, Settings.

How to run CMD command on startup automatically in Windows 11/10



Source link

www.thewindowsclub.com