Find file (.exe) from file name (path unknown)

I have an automation that needs to run j2plauncher.exe. The location of this file differs from machine to machine so I can’t search for it in a given folder/directory. How can I get the full location path of this file, simply by providing the file name?

Thanks in advance!

Search for j2plauncher.exe in the registry and you should be able to find a registry key containing the path to the file, which you can then get in your automation.

Thanks for the quick response Paul! Could you please share sample file to demo this, or perhaps a link to a similar post? I’m fairly new to UiPath…

You just search the registry manually (regedit) to find the relevant registry key.

As for getting the key’s value in your automation…

Thank you! I’ll give that a try.

By the way, if you’re sure the key will exist on the machine you don’t need to do the Invoke Code. Just use an Assign, and assign this to a string variable:

Microsoft.Win32.Registry.GetValue(*keypath*, "", "").ToString

1 Like

Hi Paul,
I tried the steps you suggested but I didn’t find j2plauncher.exe in the "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths" folder. I only found javaw.exe. My application however uses the j2plauncher.exe to open. I can see it when I inspect the element:

Update: I was able to resolve this by setting the exe path to the path for javaws.exe. This worked well for my automation.

Thank you!

Glad that worked. By the way I didn’t say use the path in the example I showed, I said search the registry for jp2launcher.exe to see if you can find a key that stores the path, and then use that registry key in your code.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.