Search code examples
blueprism

Blue Prism: Read Windows' environment variables


How do I access Windows' environment variables using Blue Prism?

I specifically need to get the value of %TEMP%, as I wish to use that value in a file saving action.


Solution

  • That's a feature that is (strangely) missing from BP. The only similar function native to Blue Prism is Get Special Folder Path in Utility - File Management that, however, returns only folders in Environment.SpecialFolders Enum, which doesn't contain temp.

    I usually write an extension to that VBO with a single VB.NET one liner:

    tmpFolder = Path.GetTempPath()
    

    Which returns:

    C:\Users\<username>\AppData\Local\Temp\