How do I access current user profile location using automation? %appdata% take me there when I try from windows run window. Which component or shape should i be using inorder to access %appdata%? I can write a script and use .net component but wondering if something pega has already.
You should be able to use the %appdata% or %userprofile% environment variable with the use of the .net file component. You can find this component using the toolbox . Right click any where on the toolbox and select choose items.
A new window should appear with tabs. One contains "OpenSpan Static Members". Click the second tab and select file directory radio button and navigate to the system's .NET directory, C:\Windows\Microsoft.NET\Framework\v2.0.50727
Choose mscorlib.dll in the directory and a list of .NET classes will display for you to use. See below for illustration.
You can then use the File.Copy and File.Create methods that appear in the toolbox within the autx to create or copy files to a specific directory. The environment variables should redirect the file to the user specified location.