How to add wildcard to a path to launch an .exe

Hi,

In the robot I am using, I have to start a process (on word). The issue is that Word keeps having new versions, so the path changes. Is there a way to add a wildcard in the path of the executable of word ?

Best regards

Hi @HBe,

I don’t think that is possible to do with paths. I imagine that when word gets a new version, this folder or file is added in a specific directory so you could try the following:

  1. Make a “base” path that is the fixed part of your path.
  2. Use the code: Directory.GetFiles(folder_path).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1) to get the last file placed in the file_path.

If word creates a new folder, you could check for Directory methods.

Hope this helps.

2 Likes

Hi,

Thank you for your answer !
Unfortunately, when Microsoft updates Word packages, Microsoft updates also other directory names (Word, Excel, PowerPoint, etc). So here for example Word is not the last element that has been updated (to order and see by creation time).
I finally went for the rescue way: in the base directory name (“C:\Program Files\WindowsApps”), looking for the directory names that contains “_x86” and “Word”.

Best regards,

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