How to invoke an ooRexx exe from a Windows menu

Help
2014-04-17
2014-04-17
  • Dave Hilliard

    Dave Hilliard - 2014-04-17

    I have written an exe that will read and scan thru a SSL trace file looking for non zero return codes and alerts. If any are found they are written to an output file. This works just fine but I have to have the SSL trace file hard coded in the exe. I don't want to have the file name hard coded.

    What I want to do is to get this exe to run when I right click on the trace file and select my exe from the windows menu. I have edited the registry (HKEY_CLASSES_ROOT), added a new key under "shell" and provided the full path to my exe. When I right click on the trace file, I select my exe to run it and I get this message "This file does not have a program associated with it for performing this action. Please install a program or, if one is already installed, create an association in the Default Programs control panel."
    My trace file is called ssl.trace and I associated .trace with my exe. I also have a trace called ssl.trc and I associated .trc with my exe and windows still says the file does not have a program associated with it.
    Any help is appreciated. Thanks!

     
    • Mark Miesfeld

      Mark Miesfeld - 2014-04-17

      ERROR! The markdown supplied could not be parsed correctly. Did you forget to surround a code snippet with "~~~~"?

      You are calling your file an "exe", but I doubt it is really an exe.  Isn't
      it just a Rexx script?  On top of that, you are mucking around in the
      registry rather than using the mechanism Windows supplies for setting up
      file associations.
      
      I'm not sure that you can get it too work, but you will need to invoke Rexx
      in the file association.  If you look at that the association set up when
      you install ooRexx you see:
      
      C:\work.ooRexx>ftype rexxscript
      rexxscript="C:\Rexx\ooRexx\rexx.exe" "%1" %*
      
      So, I would try something along the lines of:
      
      Form the command line:
      
      assoc .trc=sslTrace
      ftype sslTrace="C:\Rexx\ooRexx\rexx.exe <full path to ssl.trace>" "%1" %*
      
      or maybe:
      
      ftype sslTrace="C:\Rexx\ooRexx\rexx.exe" <"full path to ssl.trace"> "%1" %*
      
      Again, I'm not sure it will work to begin with, but you need to do
      something like that.
      
      --
      Mark Miesfeld
      
      
      
      
      
      
      On Thu, Apr 17, 2014 at 5:38 AM, Dave Hilliard <mrdave19@users.sf.net>wrote:
      
      > I have written an exe that will read and scan thru a SSL trace file
      > looking for non zero return codes and alerts. If any are found they are
      > written to an output file. This works just fine but I have to have the SSL
      > trace file hard coded in the exe. I don't want to have the file name hard
      > coded.
      >
      > What I want to do is to get this exe to run when I right click on the
      > trace file and select my exe from the windows menu. I have edited the
      > registry (HKEY_CLASSES_ROOT), added a new key under "shell" and provided
      > the full path to my exe. When I right click on the trace file, I select my
      > exe to run it and I get this message "This file does not have a program
      > associated with it for performing this action. Please install a program or,
      > if one is already installed, create an association in the Default Programs
      > control panel."
      > My trace file is called ssl.trace and I associated .trace with my exe. I
      > also have a trace called ssl.trc and I associated .trc with my exe and
      > windows still says the file does not have a program associated with it.
      > Any help is appreciated. Thanks!
      >
      >
      > ---
      >
      > [How to invoke an ooRexx exe from a Windows menu](
      > https://sourceforge.net/p/oorexx/discussion/408478/thread/f551a907/?limit=25#a8f7
      > )
      >
      >
      > ---
      >
      > Sent from sourceforge.net because you indicated interest in <
      > https://sourceforge.net/p/oorexx/discussion/408478/>
      >
      > To unsubscribe from further messages, please visit <
      > https://sourceforge.net/auth/subscriptions/>
      >
      
       
      • Dave Hilliard

        Dave Hilliard - 2014-04-17

        Mark,
        Thanks for the reply. I tried what you suggested but I still couldn't get my ssltrace.rex to get invoked by performing a right click on it.
        Your reply gave me an idea and I tried the following and I got it to work.
        This is what I did:
        I created a ssltrace.bat file with the just following in it:

        @ECHO OFF
        set path_and_filename=%1
        rexx ssltrace.rex %path_and_filename%

        I created a key in the registry in HKEY_CLASSES_ROOT that points to the ssltrace.bat that looks like this: c:\userfiles\ssl\tools\ssltrace.bat %1

        I can now right click on any trace file regardless of what the extension is and the ssltrace.rex will get invoked and use the path and filename that is passed to it from the ssltrace.bat file.

        Regards, Dave

         

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks