viewpoint-particle

Author Topic: Run association mysterious  (Read 352 times)

twright3

  • Newbie
  • *
  • Posts: 1
Run association mysterious
« on: August 27, 2022, 03:12:41 pm »
If I double click on a .jpg file in Explore it runs the application I have specified. If in WinBatch I use:
Run(jpeg_file_path,"")
A different program is run. What "association" is Run using to pick this program? Why is it different from double clicking on a file?

td

  • Tech Support
  • *****
  • Posts: 4181
    • WinBatch
Re: Run association mysterious
« Reply #1 on: August 27, 2022, 04:04:05 pm »
The why is system specific so the question cannot be answered completely. The obvious explanation is that the Windows graphic shell (the process behind the window you are clicking) and WinBatch use different search algorithms for searching all the possible file association locations to identify which executable is responsible for loading the given file extension. Try the ShellExecute function instead.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

  • Tech Support
  • *****
  • Posts: 4181
    • WinBatch
Re: Run association mysterious
« Reply #2 on: August 29, 2022, 08:21:25 am »
Also, if you have a specific application you wish to use for your "jpeg_file_path" file, you could specify it in the Run function's first parameter and place the "jpeg_file_path" in the second parameter.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade