WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: twright3 on August 27, 2022, 03:12:41 PM

Title: Run association mysterious
Post by: twright3 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?
Title: Re: Run association mysterious
Post by: td 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.
Title: Re: Run association mysterious
Post by: td 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.