Elegant approach for identifying a desktop based application

Hello,

I am trying to automate a desktop based application built for windows OS.

Can someone please suggest an elegant process or an approach on how to launch that application (abc.exe) file using UiPath studio? other than the below said approaches. This could be a great help for me!

Sceanrio1: Other than locating the desired abc.exe file from a directory path.
Case1: Chances of where user might not even have access to Server Location.
Case2: Chances of Not every time maintaining the abc.exe file in the same Server location.

Scenario2: Having a short cut created on the Users Desktop.
Case1: Chances of deleting that short cut app from the desktop manually by a User. (Unknowingly).
Case2: By identifying the “Open File location” of the installed application ref file under the User profile. (Someone has a chance to delete that file as well).

Please need your valuable suggestions and ideas towards indetifying an installed application and then launch the application using UiPath activities.

Thanks,
Sreekanth

@sreekanth.ennam,

I would suggest to have it standard path somewhere as prerequisite instead of spending bot’s time to locating the .exe. It’s totally a non value added step in your process.

May be you will have to get the process optimized first before automating for better return on investment.

Thanks,
Ashok :slight_smile:

2 Likes

When the name of the executable file does not change, one way would be to search for the file, for example using the Directory.EnumerateFiles method.

Edit: Something like this should do it

files = new List<string>();
var enumerationOptions = new EnumerationOptions()
{
	IgnoreInaccessible = true,
	RecurseSubdirectories = true
};

foreach (var drive in DriveInfo.GetDrives().Where(d => d.IsReady && d.DriveType != DriveType.Network))
{
	var foundFiles = Directory.EnumerateFiles(drive.RootDirectory.FullName, fileName, enumerationOptions).ToList();
	files.AddRange(foundFiles);
}

Place it inside “Invoke Code” activity, Language = CSharp, with 2 arguments:

  • “files” (out), type = List
  • “fileName” (in), type = string

Or adapt to UiPath activities.

On my machine it takes approx 8 seconds to find “UiPath.Studio.exe” so not that bad but depends on resources and where file is located.

1 Like

Is it an application that is not installed, there’s just an .exe that you run? You could include it in a subfolder of your project so it gets published with the project. Then you know it will always be in .\FolderName

1 Like