Windows 11 about windows batch file on startup

Solution
To prevent a specific program from starting up at Windows startup using a batch file, you would typically need to modify the startup settings rather than using a batch file to stop it from starting. However, you can create a batch file that reverts the changes made by the original script. Below is a sample script that may help you achieve this: Sample Batch Script to Stop a Program from Running at Startup:
Code:
@echo off rem ---This script disables the startup of the WinRAR program--- rem Providing the path to the registry key that controls startup programs set "regKey=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" rem Checking if the WinRAR entry exists in the registry reg query "%regKey%" /v WinRAR >nul 2>&1 if...
To prevent a specific program from starting up at Windows startup using a batch file, you would typically need to modify the startup settings rather than using a batch file to stop it from starting. However, you can create a batch file that reverts the changes made by the original script. Below is a sample script that may help you achieve this: Sample Batch Script to Stop a Program from Running at Startup:
Code:
@echo off rem ---This script disables the startup of the WinRAR program--- rem Providing the path to the registry key that controls startup programs set "regKey=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" rem Checking if the WinRAR entry exists in the registry reg query "%regKey%" /v WinRAR >nul 2>&1 if %errorlevel% EQU 0 ( rem Removing the WinRAR startup entry reg delete "%regKey%" /v WinRAR /f echo WinRAR disabled from startup. ) else ( echo WinRAR startup entry not found. ) echo Batch file execution completed. Exiting script. pause
Instructions:
  1. Copy the above script into a new text file.
  2. Save the text file with a .bat extension (e.g., disableWinRARStartup.bat).
  3. Run the batch file with administrator privileges. Please note that modifying startup programs via the Windows Registry should be done carefully to avoid unintended consequences. Make sure to back up the registry or create a system restore point before making any changes. Adjust the script as needed to target the specific program you want to prevent from starting up at boot.
 

Solution
Back
Top