Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the default program to interpret windows batch file [closed]

I am working on windows 7 and I found that "notepad" was set as the default program for opening my .bat files. So when I try to execute the batch file by double clicking, it is opened by notepad.

I have tried setting cmd.exe as the default program, which didn't work.

What is the default program I should set for executing .bat files?

like image 342
ProgramCpp Avatar asked Dec 21 '13 15:12

ProgramCpp


People also ask

What does @echo off do?

The ECHO-ON and ECHO-OFF commands are used to enable and disable the echoing, or displaying on the screen, of characters entered at the keyboard. If echoing is disabled, input will not appear on the terminal screen as it is typed. By default, echoing is enabled.

What does %1 mean in batch file?

When used in a command line, script, or batch file, %1 is used to represent a variable or matched string. For example, in a Microsoft batch file, %1 can print what is entered after the batch file name.

What program runs batch files?

When a batch file is run, the shell program (usually COMMAND.COM or cmd.exe) reads the file and executes its commands, normally line-by-line. Unix-like operating systems, such as Linux, have a similar, but more flexible, type of file called a shell script. The filename extension . bat is used in DOS and Windows.

What does %* mean in batch?

Using the %* value in a batch script refers to all the arguments (for example, %1, %2, %3...). You can use the following optional syntaxes as substitutions for batch parameters (%n): Batch Parameter.


2 Answers

Click on "Start"->"Run" and type in "REGEDT32" and press Enter to start the Registry Editor.

Find the following key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts.BAT\UserChoice

and delete the key named "UserChoice".

like image 166
Mark Setchell Avatar answered Oct 07 '22 07:10

Mark Setchell


Check the output of the following commands:

C:\>
C:\>assoc .bat
.bat=batfile

C:\>ftype batfile
batfile="%1" %*

C:\>

If your output is different, you have to correct the settings (see assoc /? and ftype /? for help)

like image 36
Stephan Avatar answered Oct 07 '22 09:10

Stephan