.bat vs .cmd

Posted on 2008-11-10
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
    LVL 95

    Accepted Solution

    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
    LVL 95

    Expert Comment

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

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    The password reset disk is often mentioned as the best solution to deal with the lost Windows password problem. In Windows 2008, 7, Vista and XP, a password reset disk can be easily created. But besides Windows 7/Vista/XP, Windows Server 2008 and ot…
    VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
    This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
    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). …

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now