Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Windows 7 command line

2010-05-19
2012-08-14
  • 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?

    Thanks!

     
  • 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

    and

    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

    .rex=REXXScript

    c:>assoc .xls

    .xls=Excel.Sheet.8

    c:>assoc .xlsx

    .xlsx=Excel.Sheet.12

    c:>assoc .lee

    File association not found for extension .lee

    c:>

     
  • Marc Schare
    Marc Schare
    2010-05-19

    Lee:

    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
    ideas?

    C:\TEMP>assoc .xls

    .xls=Excel.Sheet.8

    C:\TEMP>assoc .rex

    .rex=REXXScript

    C:\TEMP>assoc .xls

    .xls=Excel.Sheet.8

    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

    C:\TEMP>cuppheadings

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

    operable program or batch file.

    C:\TEMP>cuppheadings.xls

    C:\TEMP>

     
  • 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.

    Rick

     
  • Marc Schare
    Marc Schare
    2010-05-20

    Rick:

    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!