Overview
When trying to run a Windows batch file (.bat) to install or upgrade the Mobilogy software, you may encounter one of the following scenarios:
- The batch file opens a Command Prompt window, but the commands are not executed.
- The batch file is opened in Notepad or any other text editor.
This article describes how to fix the .bat file association settings to make these files run properly.
Information
A Windows Batch file (.bat) is a special file that you can run to execute a number of automated commands. The Command Prompt reads the batch file and runs each command specified in the file.
Users may have accidentally associated .bat files with a text editor or Command Prompt or changed the registry settings. To restore the default file association settings for .bat files, you would need to change the registry settings.
Before performing the steps below, make sure you understand what the Windows Registry is and the implications of modifying it.
Method 1: Using the BAT File Association Registry Fix (the Fastest and Safest Method)
- Download the archive with the registry fix file.
- Unzip the archive and run the enclosed registry file.
- Click Yes to confirm the changes.
- Click OK.
Method 2: Fixing the BAT File Association Manually
Important
Before proceeding, create a System Restore point as a safety measure. Incorrect modification of the Windows registry can cause serious problems.
- Run the Registry Editor.
- Go to the following key and open its Default string:
HKEY_CLASSES_ROOT\.bat
- Enter the following text in the Value data field:
batfile
- Navigate to the following key:
HKEY_CLASSES_ROOT\batfile\shell
- Open the Default string and make sure that its value is blank.
- Navigate to the following key:
HKEY_CLASSES_ROOT\batfile\shell\open\command
- Open the Default string and copy the following line in the Value data field:
"%1" %*
- Navigate to the following key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bat
The values present in the OpenWithList, OpenWithProgids, and UserChoice subkeys may be causing the problem.
- Hence, right-click on the .bat key and select Delete. Click Yes to confirm the action. This registry key and its three subkeys are trivial, and they are only required if you want to override the default .bat file association settings.
-
Exit the Registry Editor.
Method 3: Creating Your Own fix_bat.reg File
This method performs the same changes as method 2, but the changes are made automatically.
- Open Notepad or any other text editor.
- Copy the following text and paste it in your text editor:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.bat]
@="batfile"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\batfile\shell]
@=-
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\batfile\shell\open\command]
@="\"%1\" %*"
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bat] - Save this text as a file with the
.reg
extension (e.g.,fix_bat.reg
). - Run the newly created file to apply the changes to the registry. Click Yes to confirm the changes.