You have to enable the bot to resolve the local paths automatically based in it’s environments.
You can look up the Environment variables activities to see how you can do that.
For example if you have located your work folder in your Documents folder, it is obvious that the bot will break on another machine because the Documents folder path is different for each user.
Therefore you have to have your bot resolve the “full path” or absolute path to your Documents folder and then specify the full path in your activities in the automation.
This is how it might look like:
First get the path to Documents folder (on any machine) by looking up the appropriate environment variable and assign it to a variable say “sBasePath”
Next in your file activity (example Write to File) , specify the full path by using the base path above:
Now, this approach would work if you know for sure users are putting their folders under a standard folder such as Documents. But what do you do it a user wants to put their folders in a non-standard location?
For example: C:\MyFiles\MyReports
In this case you can have your automation accept input arguments to main.xaml so that users can pass in the base file paths as inputs the the Automation either from Orchestrator (if automation is unattended) or the UiPath Assistant (if automation is attended).