cancel
Showing results for 
Search instead for 
Did you mean: 

Mainframe path with %userprofile%

PvD_SE
Level 12

Hi,

We're switching Mainframe applications where the new one happens to be installed in the Document folder. As the Documents folder has a path like  c:\users\MyUserProfile\Documents\... and includes my user profile, we seem to have an issue defining the path to the new application. The old application ran from c:\Program files\... and posed as such never any problems launching. But with the new application we seem to need a dynamic path to get the MyUserProfile bit in place.

When we will run the new application objects in production, MyUserProfile obviously needs to be replaced by RpaUserProfile, preferably in a dynamic fashion. So we need to find a solution to make the VBO for the new application work in development as well as in production.

I got tipped to replace MyUserProfile with %userprofile%, making the path look like c:\users\%userprofile%\Documents\... . While BP apparently accepts that path in the Application Modeller in 'Path to session file', the application does not launch. Instead it crashes with message "Error - Failed to launch application - Launch failed: Error from ConnectToHostOrSession: File is in untrusted location."

It is unclear to me if BP manages to replace %userprofile% with MyUserProfile and crashes for some other reason ('untrusted location') or that it is indeed value %userprofile% that is disliked by BP.

Notes:
- I did search the BP portal document section as previous questions on this subject pointed there. However, my particular challenge was not handled there.
- Installing the new Mainframe application in the c:\Program files\... folder would obviously solve my problem, but for some reason seems not possible in this environment. 

Questions:
1. How can I define the path in 'Path to session file' in my application modeller including a user profile?
2. If the above cannot be done, in what other direction should I proceed investigations?

Thanks in advance for any contributions!



------------------------------
Happy coding!
Paul
Sweden
------------------------------
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)
5 REPLIES 5

NicholasZejdlik
Level 9
Sorry, I misunderstood the issue. Don't know how to help with that one.

%userprofile%
expands to c:\users\<username>. Try using %userprofile%\Documents\... instead of c:\users\%userprofile%\Documents\...

------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------

JamesCox-Schemb
Level 2
Do you have the option to input the path on the launch or attach navigate stage?
This essentially overrides the path (if any given) in the app model and because you can input that into your object it is dynamic. Therefore using the Get User Name action you can build the path to the document folder depending on what profile is running the object/process.
We use this successfully with IBM Personal Communicator (COM API).

------------------------------
James Cox-Schembri
RPA Developer
HSBC
Europe/London
------------------------------

Hi James,

Thanks for your answer!

We do indeed have this option on the Launch action that has a Path parameter. The help text states: "The parameters supplied in the Application Modeller wizard may be optionally overridden in this call". Assuming this statement also applies to the path, this sounds like it might do the trick and we'll definitely test it.



------------------------------
Happy coding!
Paul
Sweden
------------------------------
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)

In our company we use IBM Mainframe. We avoided using the Username of the logged in user in the path and used a solution like this instead:

our file location:
%Appdata%\IBM\Personal Communications\host.ws

%Appdata% is usually a path like ⇒ C:\Users\{insert username}\AppData\Roaming

it contains the username of the logged in user automatically. so you could use a  .bat file to start an application that is stored relatve to the user folder and do something like this:
cmd.exe
cd %appdata%
cd ..
cd ..
myfile.exe




------------------------------
Marco Matuttis
Robot Process Automation Developer
INTER Krankenversicherung AG
Mannheim
------------------------------

Hi Marco,

Thanks for your contribution.

As said, we'll be trying James' proposal first as it is fully parameter driven. We'll keep yours handy in case an alternative solution is required.

------------------------------
Happy coding!
Paul
Sweden
------------------------------
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)