To run a .bat
file on Windows, use the Command Prompt or double-click the file. From the Command Prompt:
- Navigate to the directory containing the
.bat
file:cmdcd path\to\directory
- Execute the
.bat
file by typing its name:cmdfilename.bat
Alternatively, specify the full path:
cmd
path\to\directory\filename.bat
If the .bat
file requires administrator privileges, right-click the file and select Run as administrator, or open the Command Prompt as an administrator before running the command.