How can I retrieve the name of the current process from within the process itself

How can I retrieve the name of the current process from within a xaml?

We are trying to centralize the location of screenshot taken by the RE-Framework. So within the TakeScreenshot.xaml, we need to retrieve the process name so that the screenshots can be dropped into a folder named after the process itself.

Hey @dbiswas check out this post: Get UiPath Robot environment name, and Process name at runtime at the Robot client

1 Like

Hi all, I’ve found a solution that I like a little better. You can use the command Process.GetCurrentProcess.MainWindowTitle

So long as your project name matches the name of the folder that it’s contained in (I sort of like that it encourages making these match).

This method also has the added advantage of providing the name of the Orchestrator environment that the job was run in. Unfortunately, I can’t find any other way to get the version, though, so if you need that the other method will be the way to go.

4 Likes

Follow up: Just wanted to note that we’ve recently started using the new “Background Processes” and this method doesn’t work for them.