Change working directory for Notepad

I’m looking for a way to get and possibly change the working directory of the Notepad application. It seems like ‘Directory.GetCurrentDirectory’ ‘Directory.SetCurrentDirectory’ should work, but I don’t know how to point that to Notepad application in the ‘Invoke Method’ activity. How should specify the ‘TargetType’ or ‘TargetObject’. In my case, Notepad is already open, and I don’t want to reopen it with a working directory.

I’m a bit confused - you want to change the directory where notepad is installed? Or do you just want to know the directory where notepad is installed?

I don’t think you can change the directory where the notepad.exe is installed.

If you just want to know the directory an application comes from, you can do that by grabbing the ‘AppPath’ attribute from the application selector, and you can get the name of the app from the ‘app’ attribute. To get the full filepath just concatenate the ‘AppPath’ + “” + ‘app’

Sorry I wasn’t clear enough. I want to change the working directory where Nodepad will open and save files. I was hoping to do that outside the UI open and save dialog boxes under the File menu if possible.

It doesn’t really have anything to do with uipath, but assuming you have windows 10, you can view how to change the default location at that link.