Windows 7 command line

  • Marc Schare

    Marc Schare - 2010-05-19

    I note that with OOREXX, I seem to be able to initiate a REXX program directly
    from the Windows 7 command line without having to key in "REXX" first. How was
    this accomplished?


  • Lee Peedin

    Lee Peedin - 2010-05-19

    .rex is "associated" with the Rexx executable

    AFAIK it's always been that way with ooRexx

  • Marc Schare

    Marc Schare - 2010-05-19

    True, but if I type in the name of an Excel spreadsheet from a windows command
    line, it doesn't go and launch Excel. How does Windows 7 know to launch REXX
    based on a command that I type at a command prompt.

  • Lee Peedin

    Lee Peedin - 2010-05-19

    If I type the name of an Excel spread sheet my Windows XP system opens it up
    with Excel and I'm sure if I tried it on my Windows 7 system (it's at home),
    it would do the same.

    At a command line, type in the following

    assoc .rex

    And see what comes back

    Now try

    assoc .xls


    assoc .xlsx

    Now, since I'm sure you probably don't have any files with a .lee extension
    :-), try this

    assoc .lee

  • Lee Peedin

    Lee Peedin - 2010-05-19

    Oops, forgot to include my results

    c:>assoc .rex


    c:>assoc .xls


    c:>assoc .xlsx


    c:>assoc .lee

    File association not found for extension .lee


  • Marc Schare

    Marc Schare - 2010-05-19


    Below are mine. REXX programs always run if I give the name of the REXX
    program without the .REX suffix and without the REXX command. For
    spreadsheetings, if I give the proper suffix on the command line, Excel will
    start - otherwise, it will not. Here is the session. Thanks for you help - any

    C:\TEMP>assoc .xls


    C:\TEMP>assoc .rex


    C:\TEMP>assoc .xls


    C:\TEMP>dir *.xls

    Volume in drive C is HP

    Volume Serial Number is 6C79-BF50

    Directory of C:\TEMP

    03/08/2010 01:26 PM 25,088 cuppheadings.xls

    1 File(s) 25,088 bytes

    0 Dir(s) 843,016,990,720 bytes free


    'cuppheadings' is not recognized as an internal or external command,

    operable program or batch file.



  • Rick McGuire

    Rick McGuire - 2010-05-19

    The PATHEXT environment variable determines the file extensions that are
    searched for commands by the command shell. You can easily add .xls to that
    list to get excel files to be treated the same way.


  • Marc Schare

    Marc Schare - 2010-05-20


    30 years of DP experience and I didn't know about PATHEXT. What a handy little
    factoid for command line junkies. That explains the behavior - thanks!


Log in to post a comment.