Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: What Comes Up When Run Is Typed. .Exe or .Com. Why  (Read 3077 times)

0 Members and 1 Guest are viewing this topic.

zipcool

  • Guest
What Comes Up When Run Is Typed. .Exe or .Com. Why
« on: October 09, 2006, 10:30:27 PM »
Hi. Just improving my somewhat limited knowledge. What Comes Up When Run Is Typed at the DOS prompt. Run.Exe or Run.Com.  And why. Appreciate an answer as I am undertaking a course to improve my cyber IQ.

Fanks

Zipcool ::)

GuruGary



    Adviser
    Re: What Comes Up When Run Is Typed. .Exe or .Com.
    « Reply #1 on: October 09, 2006, 10:52:40 PM »
    To make sure I understand, you are asking which file would be run if you type RUN and you have both a RUN.EXE and a RUN.COM file in the same directory?

    If that is the question, then the answer depends on your version of Windows (or DOS).  For Windows XP / 2003, the .EXE file would take precedence.  For real-mode DOS or Win 9x, and I think 2000, the .COM file would take precedence.

    zipcool

    • Guest
    Re: What Comes Up When Run Is Typed. .Exe or .Com.
    « Reply #2 on: October 10, 2006, 12:01:57 AM »
    Thanks for replying Gary. I'm not assuming there is either a RUN.EXE and a RUN.COM file in the same directory?

    I just wanted to know which file would run if I type Run at the DOS command prompt. Would it be the run.exe or run.com?

    For real-mode DOS or Win 9x, and I think 2000, the .COM file would take precedence. Why?

    Fanks :-?

    Zipcool

    GuruGary



      Adviser
      Re: What Comes Up When Run Is Typed. .Exe or .Com.
      « Reply #3 on: October 10, 2006, 12:40:48 AM »
      So you are asking which types of files can be run?  That also depends on the operating system.  With Windows XP, the default file types that can be run without specifying the extension would be .COM, .EXE, .BAT, .CMD, .VBS, .VBE, .JS, .JSE, .WSF, .WSH. So you could have any of the following:
      RUN.COM
      RUN.EXE
      RUN.BAT
      RUN.CMD
      RUN.VBS
      RUN.VBE
      RUN.JS
      RUN.JSE
      RUN.WSF
      RUN.WSH

      You can look at your PATHEXT environment variable to verify this on your system.
      Code: [Select]
      echo %pathext%

      GuruGary



        Adviser
        Re: What Comes Up When Run Is Typed. .Exe or .Com.
        « Reply #4 on: October 10, 2006, 12:44:23 AM »
        Quote
        For real-mode DOS or Win 9x, and I think 2000, the .COM file would take precedence. Why?

        Oh, and to answer your other question about precedence ... I think the answer is just because that Bill Gates (Microsoft) decided it should be that way.

        http://support.microsoft.com/kb/35284

        QBasicMac

        • Guest
        Re: What Comes Up When Run Is Typed. .Exe or .Com.
        « Reply #5 on: October 10, 2006, 06:21:26 AM »
        Quote
        What Comes Up When Run Is Typed. .Exe or .Com. Why
        Zipcool ::)

        As pointed out, the order of precidence is established by
        Code: [Select]
        echo %pathext%
        .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH

        Why did they choose this particular order rather than another? I don't know if they documented that debate.

        I do know that some programs, like BASICA had both a COM and EXE. If you typed BASICA, the COM would get control and then call the EXE. If you removed the COM, then the EXE worked fine anyway. I never understood what the deal was.

        But the point is that EXE files tend never to call COM because anything you could do in a COM could easily be added to the EXE. But not vv.

        Mac


        zipcool

        • Guest
        Re: What Comes Up When Run Is Typed. .Exe or .Com.
        « Reply #6 on: October 10, 2006, 06:45:03 PM »
        Thankyou both. . com it is. It was a question in an IT test that I had to send in to be marked.

        Fanks.

        Zipcool :)