Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is different between *.bat and *.sh and *.exe file?

When I start Apache Tomcat

start
    tomcat/bin/startup.bat
    tomcat/bin/startup.sh
stop
    tomcat/bin/shutdown.bat
    tomcat/bin/shutdown.sh  

1. What is different between *.sh and *.bat and *.exe file?

So I know file follow that is like a program.

 - *bat, *cmd - Batch, Comand
 - *exe - C
 - *jar - Java

I can read, understand script content in the *bat file.

2. Why don't use *exe instead *sh, *bat file to run ?

3. How the structure is in *bat, *sh, *exe file ?

like image 895
iCrazybest Avatar asked Jan 10 '15 07:01

iCrazybest


People also ask

What is a .sh file used for?

What is a SH file? A file with . sh extension is a scripting language commands file that contains computer program to be run by Unix shell. It can contain a series of commands that run sequentially to carry out operations such as files processing, execution of programs and other such tasks.

Can you turn a .bat into an EXE?

Converting BAT Scripts to EXE with Bat To Exe Converter If you're not into performing tedious steps like IExpress, a popular third-party tool converts . bat to .exe file and is more effective and convenient. Bat To Exe Converter is a free yet handy tool that quickly converts one or several .

What is batch EXE?

Batch scripts are the series of commands stored in a plain text file that can be executed by the command-line interpreter. Whereas executable files are used to perform various operations and tasks on a computer.


1 Answers

A .bat file is a windows batch file it contains a sequence of windows/dos commands. These cannot be used in a Unix shell prompt.

A .sh file is a unix shell script it contains a series of unix commands. These cannot be ran in a Windows DOS or Powershell prompt.

An .exe is windows-only executable format, which may in-turn execute a .bat script or other compiled code. Also cannot be directly used in a Unix prompt.


Each can easily launch a series of commands, or a single command that requires complex environment variables or arguments. You can open a .bat file or the .sh file in a text editor like notepad and view the commands they're running.

like image 168
Jason M Avatar answered Sep 29 '22 05:09

Jason M