Menu

#960 .cmd file extension not recognized

closed
None
5
2016-01-20
2010-11-15
No

When I try to run a rexx program with a file extension of .cmd on windows, with version 4.xx, it doesn't recognize the .cmd extension I supply it.

e.g
REXX makeall.cmd works
REXX makeall doesn't

Related

Bugs: #960

Discussion

  • Mark Miesfeld

    Mark Miesfeld - 2010-11-16

    This isn't a bug, it's working as intended. There is no attempt in the Windows installer to set up a file association with .cmd. It is done, intentionally, only for .rex.

    You can add an association for .cmd yourself, if you want to.

    The Windows installer sets up, correctly, the RexxScript file type. The .rex extension is associated with Rexxscript:

    C:\temp>ftype RexxScript
    RexxScript="C:\Rexx\ooRexx\rexx.exe" "%1" %*

    C:\temp>assoc .rex
    .rex=RexxScript

    If you want to add the .cmd extension, you just need to associate .cmd with RexxScript. You can do that from the command line by typing:

    C:\temp>assoc .cmd=RexxScript
    .cmd=RexxScript

    Normally, you would also need to add .cmd to PATHEXT, but on Windows systems, it is already in the PATHEXT:

    C:\temp>set PATHEXT
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.rex;.rexg;.rexp

    The reason it is already in the PATHEXT is because normally, on Windows, .cmd files are associated with the Windows command processor.

    It is up to you if you want to change that. I normally wouldn't recommend it to someone, but it's your system and you can do what you want with it.

    However, since it is actually Windows that sets up this association, we are not going to over-ride it.

     
  • Anonymous

    Anonymous - 2016-01-20

    This worked in ooRexx 3.x and all the back to the original IBM Ojbect Rexx. What about backward compatibility? Why was this changed?

     
  • Erich

    Erich - 2016-01-20

    Starting with 32-bit Windows, the .CMD extension (in addition to the .BAT extension) is used by Windows itself to run batch commands. If ooRexx changed .CMD from cmdfile to RexxScript, it might have a big (unwanted) impact.

    You can easily make this change by issuing the command
    assoc .cmd=RexxScript

     
    • Bruce

      Bruce - 2016-01-20

      In the Rex language reference it has details on how an external Rex file is found in section 7.2.1.1 "Locating External Rexx Files"

      Sent by Magic!

      On Jan 20, 2016, at 8:26 AM, Erich erich_st@users.sf.net wrote:

      Starting with 32-bit Windows, the .CMD extension (in addition to the .BAT extension) is used by Windows itself to run batch commands. If ooRexx changed .CMD from cmdfile to RexxScript, it might have a big (unwanted) impact.

      You can easily make this change by issuing the command
      assoc .cmd=RexxScript

      [bugs:#960] .cmd file extension not recognized

      Status: closed
      Group:
      Created: Mon Nov 15, 2010 10:18 PM UTC by David Oakford
      Last Updated: Wed Jan 20, 2016 01:35 PM UTC
      Owner: Mark Miesfeld

      When I try to run a rexx program with a file extension of .cmd on windows, with version 4.xx, it doesn't recognize the .cmd extension I supply it.

      e.g
      REXX makeall.cmd works
      REXX makeall doesn't

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/oorexx/bugs/960/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #960

      • Anonymous

        Anonymous - 2016-01-20

        It's interesting to note that the ooRexx Reference manual for 3.1.2 shows the following in section 8.2.1 - stating that it will look for .CMD files

        The search order for external functions is as follows:
        1. Functions defined on ::ROUTINE directives within the program.
        2. Public functions defined on ::ROUTINE directives of programs referenced with ::REQUIRES.
        3. Functions that have been loaded into the macrospace for preorder execution. (See the Open Object
        Rexx: Programming Guide for details.)
        4. Functions that are part of a function package. (See the Open Object Rexx: Programming Guide for
        details.)
        5. Rexx functions in the current directory, with the current extension.
        6. Rexx functions along environment PATH, with the current extension.
        7. Rexx functions in the current directory, with the default extension (.REX or .CMD).
        8. Rexx functions along environment PATH, with the default extension (.REX or .CMD).
        9. Functions that have been loaded into the macrospace for postorder execution.

         
    • Bruce

      Bruce - 2016-01-20

      I could be wrong, but I thought that there was an environment variable that could be set that would define the suffices and suffix search order. Perhaps in the programmers reference.
      Bruce

      Sent by Magic!

      On Jan 20, 2016, at 8:26 AM, Erich erich_st@users.sf.net wrote:

      Starting with 32-bit Windows, the .CMD extension (in addition to the .BAT extension) is used by Windows itself to run batch commands. If ooRexx changed .CMD from cmdfile to RexxScript, it might have a big (unwanted) impact.

      You can easily make this change by issuing the command
      assoc .cmd=RexxScript

      [bugs:#960] .cmd file extension not recognized

      Status: closed
      Group:
      Created: Mon Nov 15, 2010 10:18 PM UTC by David Oakford
      Last Updated: Wed Jan 20, 2016 01:35 PM UTC
      Owner: Mark Miesfeld

      When I try to run a rexx program with a file extension of .cmd on windows, with version 4.xx, it doesn't recognize the .cmd extension I supply it.

      e.g
      REXX makeall.cmd works
      REXX makeall doesn't

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/oorexx/bugs/960/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #960

    • Anonymous

      Anonymous - 2016-01-20

      I don't think you got the point I was trying to make.
      Something change in ooRexx.
      I am running ooRexx 3.1.2 on Windows 7 and there is no association in Windows between .cmd and RexxScript. Windows only shows .cmd associated with cmdfile. Something within ooRexx knew to look for rexx in .cmd files, but not Windows. Why was this changed? Why is ooRexx not backward compatible?

       

Anonymous
Anonymous

Add attachments
Cancel