Support Portal

for ProcessRobot and WinAutomation

Start a new topic
Answered

WA - Proper usage of %Username% when accessing/writing to files

I would like to know how to access (username independent)

C:\Users\<Your_Username>\Desktop when writing/opening files from WinAutomation. 


I know its in WINDOWS desktop environment you can type %username% and its automatically converted into the specific User's name.

and that the % symbol should be escaped. 


I tried:  C:/Users/\%USERNAME\%/Desktop/something.txt

but it doesn't work, as the %username% is not converted to the actual username, throwing an invalid directory specified error . 


 




Best Answer
Get special folder action with option to get path to the current logged in user's desktop folder

Answer
Get special folder action with option to get path to the current logged in user's desktop folder

Thanks I found it in the Help. It works just fine now.

Login or Signup to post a comment