Have you ever experienced the frustration of having to manually restart a desktop application every time your Windows host reboots? This can be especially annoying if you rely on certain apps for work or productivity. Fortunately, there is a simple solution to this problem: auto restarting a desktop app after a Windows host reboot. In this article, we will guide you through the process of setting up automatic app restarts, so you can save time and avoid the hassle of manually launching your favorite apps.
Step 1: Create a Shortcut for the App
The first step is to create a shortcut for the app you want to automatically restart. To do this, follow these steps:
- Locate the app's executable file. This is usually located in the "Program Files" or "Program Files (x86)" folder on your Windows system drive.
- Right-click on the executable file and select "Create shortcut" from the context menu.
- A shortcut to the app will be created in the same folder.
- Drag the shortcut to your desktop or any other convenient location.
Step 2: Create a Batch File
Next, we need to create a batch file that will launch the app and automatically restart it if the Windows host reboots. Here's how:
- Open Notepad or any other text editor.
- Copy and paste the following code into the text editor:
@echo off
:start
start "" "C:\Path\To\Your\App.lnk"
ping -n 5 127.0.0.1 > nul
goto start
Make sure to replace "C:\Path\To\Your\App.lnk" with the actual path to the shortcut you created in Step 1.
- Save the file with a .bat extension. For example, you can save it as "AutoRestart.bat".
Step 3: Add the Batch File to Startup
Now that we have the batch file ready, we need to add it to the Windows startup folder so that it runs automatically after a reboot. Here's how:
- Press
Win + Rto open the Run dialog box. - Type "
shell:startup" (without quotes) and press Enter. - A File Explorer window will open, showing the Startup folder.
- Copy the batch file you created in Step 2 and paste it into the Startup folder.
That's it! The app will now automatically launch and restart if the Windows host reboots.
Remember, if you ever want to stop the automatic restarts, simply remove the batch file from the Startup folder.
Conclusion
Auto restarting a desktop app after a Windows host reboot can save you time and eliminate the need for manual intervention. By following the steps outlined in this article, you can easily set up automatic app restarts and enjoy a hassle-free computing experience.
| Source | Link |
|---|---|
| Microsoft Docs | https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/start |