"Open With" behaviour


  1. Posts : 702
    Win10 x64 Pro - 2 desktops, 2 laptops
       #1

    "Open With" behaviour


    I have a "portable" program - executed from a USB flash drive or from an internal drive - that adds itself to the Open With list in a file's context menu. Is there any way to in a script to determine the path to that program? I want to be able to have a script determine which copy of the program is running.

    I'm currently running Win10 21H1, but I need a technique that will also work on old Win7 computers.
      My Computer

  2. steve108's Avatar
    Posts : 19,301
    19041.1466 - 2004/20H1 Pro x64
       #2

    If you use Task Manager - Processes and find the app and right click on it to see properties, you'll see the folder it's running from.

    You can also enable the Command line column to see where apps are running from.
      My Computer


  3. Posts : 702
    Win10 x64 Pro - 2 desktops, 2 laptops
    Thread Starter
       #3

    Thanks, but I need to do this in a script.

    If the program is already running, invoking it again from an Open With list causes the program to process the associated file. I want to do this from a script, but I need to make sure I'm invoking the same copy of the program.
      My Computer

  4. steve108's Avatar
    Posts : 19,301
    19041.1466 - 2004/20H1 Pro x64
       #4

    I see. You'll probably have to dive into the registry key to pluck it out then. You can try searching the registry for the app name, then write a script to get the key value/path.
      My Computer

  5. steve108's Avatar
    Posts : 19,301
    19041.1466 - 2004/20H1 Pro x64
       #5
      My Computer


  6. Posts : 702
    Win10 x64 Pro - 2 desktops, 2 laptops
    Thread Starter
       #6

    steve108 said:
    I'll look into that, but I think I've been overthinking this. I've created the environment where the portable program lives - it's library is either a top level directory on a flash drive or is in some parent directory on an internal drive. I can just make sure script's directory is also a top level in the flash drive or is ion the same parent directory on the internal drive.
      My Computer


  7. Posts : 193
    Win 10 - 21H1
       #7

    Hello, something as a possible option. Somewhere in the portable program's files will be something that sets the name that shows up in Open with, and so on. As I understand it, you have a duplicate program, in the open with menu, and you want to know which one is running. Why not make a different name for each one. As @steve108 mentioned, the info will be in the registry. I've been looking at some exe's with Resorces Hacker, but that's not where that info would be saved for registry edits. What is your portable software?
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 11:20.
Find Us




Windows 10 Forums