Wrong file launched in Windows 10's Run function when env.var. Path contains multiple files with similar names

40 Views Asked by At

I've looked through all kinds of threads, but I can't find any appropriate solutions to the following issue:

(Windows 10 Pro, en-US)

I have WinSCP installed. Within its application directory are these two relevant files: WinSCP.com WinSCP.exe

I added the application directory to the Windows' environmental Path, however whenever I run "winscp" it is the com file that is launched and not the exe. The exe is never launched. I can only assume Windows picks the first hit, sorted alphabetically...

What would be the fix for this? I would like to run the exe and not the MS-DOS file (not ever). In fact if I could filter away file types so things like ".com" files are never launched from the run prompt, that would also solve this issue.

1

There are 1 best solutions below

0
Christophe On

You can use the App Paths registry key: create a subkey WinSCP.exe, in the Default value, put the full path of your WinSCP.exe

Here's a sample reg file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winscp.exe]
@="C:\\Program Files (x86)\\WinSCP\\WinSCP.exe"