element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Autodesk EAGLE
  • Products
  • More
Autodesk EAGLE
EAGLE User Support (English) Use the .com extension for the command line executable on Windows
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Autodesk EAGLE to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 4 replies
  • Subscribers 180 subscribers
  • Views 976 views
  • Users 0 members are here
Related

Use the .com extension for the command line executable on Windows

Former Member
Former Member over 13 years ago

A usual problem when compiling programs on Windows is that GUI executables cannot write to the command line from which they are started. To do that you have to compile them as Console executables, but then there is always an annoying command line window poping up when running it from a shortcut.

 

The solution is to ship two executables, one compiled as GUI, one as Console, and that is what Eagle is doing. The GUI executable is eagle.exe, and the Console executable is eaglecon.exe.

 

An informal convention when using that dual executable solution is to use the same base name for the two files, but using the .com extension for the Console executable. This has the advantage that you only have a single name to document and remember ("eagle"), but thanks to the default order of extensions in the Pathext environment variables, eagle.com has priority over eagle.exe when run from a command line (and one can still explicitly run the GUI version by typing "eagle.exe"). In shortcuts the full path to the .exe is necessary anyway, so it's not a problem to have a "conflicting" .com file. This convention is used for example by the Microsoft Visual Studio IDE (devenv.exe for shortcuts, devenv.com for command line use and scripting), or the Inkscape open source vector graphics editor (inkscape.exe for shortcuts, inkscape.com for command line use and scripting).

 

My suggestion is then to simply rename the file "eaglecon.exe" to "eagle.com".

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    Former Member over 13 years ago

    Jérôme Vuarand wrote on Wed, 01 August 2012 12:50

    An informal convention when using that dual executable solution is to

    use the same base name for the two files, but using the .com extension

    for the Console executable.

     

    There is no such convention.  Furthermore, the file name suffix ".com"

    already has a specific meaning.

     

    Quote:

    My suggestion is then to simply rename the file "eaglecon.exe" to

    "eagle.com".

     

    Really bad idea.

     

    Some other convention could be used though.  For example, I add "_w" to GUI

    executables, like myprog.exe for the command line and myprog_w.exe for the

    window version.  You want the command line version to be the simple name

    since you have to type it.  The GUI version can be more convoluted since it

    is generally run from a menu item with the actual executable name hidden

    from the user.

     

    The Eagle convention is fine too.  The point is there is no standard, just

    various things people have done.  There is also little need for one.  There

    is no problem to solve here.  Let's move along and stop diverting the

    developer's attention on frivolous issues like this.

     

    --

    Web access to CadSoft support forums at www.eaglecentral.ca.  Where the CadSoft EAGLE community meets.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Former Member
    Former Member over 13 years ago

    Jérôme Vuarand wrote on Wed, 01 August 2012 12:50

    An informal convention when using that dual executable solution is to

    use the same base name for the two files, but using the .com extension

    for the Console executable.

     

    There is no such convention.  Furthermore, the file name suffix ".com"

    already has a specific meaning.

     

    Quote:

    My suggestion is then to simply rename the file "eaglecon.exe" to

    "eagle.com".

     

    Really bad idea.

     

    Some other convention could be used though.  For example, I add "_w" to GUI

    executables, like myprog.exe for the command line and myprog_w.exe for the

    window version.  You want the command line version to be the simple name

    since you have to type it.  The GUI version can be more convoluted since it

    is generally run from a menu item with the actual executable name hidden

    from the user.

     

    The Eagle convention is fine too.  The point is there is no standard, just

    various things people have done.  There is also little need for one.  There

    is no problem to solve here.  Let's move along and stop diverting the

    developer's attention on frivolous issues like this.

     

    --

    Web access to CadSoft support forums at www.eaglecentral.ca.  Where the CadSoft EAGLE community meets.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • CSWalt
    CSWalt over 13 years ago in reply to Former Member

    Hi,

     

    On 08/01/12 19:08, Olin Lathrop wrote:

    Jérôme Vuarand wrote on Wed, 01 August 2012 12:50

    >> An informal convention when using that dual executable solution is to

    >> use the same base name for the two files, but using the .com extension

    >> for the Console executable.

     

    There is no such convention.  Furthermore, the file name suffix ".com"

    already has a specific meaning.

     

    Quote:

    >> My suggestion is then to simply rename the file "eaglecon.exe" to

    >> "eagle.com".

     

    Really bad idea.

     

    Some other convention could be used though.  For example, I add "_w" to GUI

    executables, like myprog.exe for the command line and myprog_w.exe for the

    window version.  You want the command line version to be the simple name

    since you have to type it.  The GUI version can be more convoluted since it

    is generally run from a menu item with the actual executable name hidden

    from the user.

     

    The Eagle convention is fine too.  The point is there is no standard, just

    various things people have done.  There is also little need for one.  There

    is no problem to solve here.  Let's move along and stop diverting the

    developer's attention on frivolous issues like this.

     

    I agree. It's difficult to make everybody happy on questions like this.

    As long there is no real need to change that we keep it.

     

    Regards,

    Walter Spermann

     

     

    --

    -


    Walter Spermann

    Softwareentwicklung

    CadSoft Computer GmbH

    Pleidolfweg 15

    84568 Pleiskirchen

    Tel.: 08635/6989-10

    www.cadsoft.de

    -


    Registergericht: Amtsgericht Traunstein HRB 5573

    Geschäftsführer: Thomas Liratsch

    -


     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 13 years ago in reply to Former Member

    Olin Lathrop wrote:

    Really bad idea.

    Telling something is a bad idea mandates some explanation. Otherwise it's just an opinion, and I don't think your opinion matters nearly as much as the one from the Microsoft Visual Studio team.

    Olin Lathrop wrote:

    There is no problem to solve here.  Let's move along and stop diverting the developer's attention on frivolous issues like this.

    There may be no problem for you, that's a problem for me. Anyways the forum is named "suggestions", not "bug reports", and even if there is no problem that's a place to propose improvements. So I will kindly ignore your message and continue "diverting the developer's attention" on issues like this.

     

    Walter Spermann wrote:

    I agree. It's difficult to make everybody happy on questions like this. As long there is no real need to change that we keep it.

    Fair enough. My goal was just to improve consistency with other platforms where I assume a single "eagle" binary name is used, and with other applications that use a different naming convention on Windows to solve the same problem. Of course that was never meant as a high priority request, just a personal opinion.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • dukepro
    dukepro over 13 years ago in reply to Former Member

    On 08/01/2012 01:08 PM, Olin Lathrop wrote:

    Quote:

    >> My suggestion is then to simply rename the file "eaglecon.exe" to

    >> "eagle.com".

     

    Really bad idea.

     

    I agree.  The ".com" extension is a left over from the CP/M days and

    even earlier than that in the PDP-10 and PDP-11 days.  It was used to

    designate a "command" other than what was built into what one could

    loosely refer to as a shell.  At the time it was called a "command

    interpreter".

     

    Unlike most other file extensions, a ".com" file is expected to be

    loaded at address 0x100 and the first instruction is to occur at that

    address.  It's a pure binary file that contains all the code and data

    objects a program needs to execute.  This was adapted for MS-DOS and the

    80x86 when segment registers were introduced to expand addressable

    memory beyond 64k.  In this case, the CS register was set to an

    arbitrary value as determined by the OS, and the .com file was loaded en

    masse at offset 0x100, providing backward compatibility with binary code

    for CP/M.

     

    More modern executables, including ".exe", have what's called a magic

    number in the first few bytes of the file.  The magic number is a unique

    value that identifies the format of the file's content.  "MZ" identifies

    a Windows executable.  This particular format describes different

    segments of the file that are to be loaded in different segments of

    memory (text, data, bss, etc.).

     

    One executable file format for unix-like systems is "ELF" (Exectucable

    and Linkable Format), with the first four bytes of the file containing

    ".ELF".  Like the "MZ" format, ELF files contain descriptors for loading

    text, data, and bss segments as well as relocation.

     

    Another example are scripts for perl, shell, and other interpreted

    languages start with a "#!".  Batch files for CP/M, MS-DOS, Windows, etc

    do not contain any magic number and rely entirely on the shell to

    properly identify the file's format based solely on the file's extension.

     

    Some kernels will try to identify the format of the file image

    regardless of the extension.  This, of course, has its benefits, but it

    also opens a security hole should an arbitrary binary data file happen

    to contain a magic number recognized by the kernel.  One could wind up

    executing data.

     

    This is by no means an exhaustive list of file formats, but merely a few

    examples of more common formats.

     

    For these reasons, it is generally considered a bad idea to rename a

    .exe to .com.

     

    HTH

     

        - Chuck

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube