.bat vs .cmd

Posted on 2008-11-10
Medium Priority
Last Modified: 2012-05-05
Just a quick question.  If I have a Test.bat and a Test.cmd in the same folder then from a command line in the folder where they exist if you just type test which file executes first and why.  Is there anything that makes one file run over the other or is it just because .bat first in the alphabet that .cmd?  now if I just specify the file either Test.bat or Test.cmd then I already know which will execute.

Question by:trooper307
  • 2
LVL 97

Accepted Solution

Lee W, MVP earned 75 total points
ID: 22927191
I believe the order of execution is based on the PATHEXT variable.  Though, why do you have any .BAT files at all?  TECHNICALLY, there is a difference... ..bat extentions are executed in a 16bit VDM while .cmd extentions are executed in a 32bit VDM.  (from a comment found here http://www.pcreview.co.uk/forums/thread-1466057.php)
LVL 97

Expert Comment

by:Lee W, MVP
ID: 22955430
And the B grade is... because I used the word "believe"?

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The way I use Experts Exchange to assist me in analyzing and diagnosing a problem is I first enter a Verbose Question at Experts Exchange like: Office 2007 will hang when opening and saving files I then launch WordPad (any text editor will do) an…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question