Here is an easy way to restart a program with the Windows command line by using the Windows command script. In this situation, I will create a script to restart Outlook minimized. There might be other specific needs, and some of them are in this post.
Restart program with Windows command line in 2 steps
- Use command taskkill to close the program by using the image name of the process to be terminated. Here is another example of how to close Excel with the Windows command line.
- Use command start to open the program and minimized if necessary. Here are is more about running minimized.
taskkill /f /im outlook.exe start /min outlook.exe
You can put those two lines of code in a batch or cmd file and schedule with Windows Scheduler.
If you are working with Windows batch files then it is a good idea to run them minimized. Nothing can be more annoying than a window popping up in situations where you don’t want it.
Another tool is Autologon that might be useful after Windows restart to log in user automatically. This and other tools from Microsoft Sysinternals utilities might be very helpful with various automation and other tasks.