Skip to main content

I'm creating a bot that is able to access folder:

c:\user\username\downloads (username can be dynamic depends on who's

logged on the computer to use the bot)

Please see screen shot and kindly advise.

thanks,

Hi,

 

You can use a bat file to get the enviroment variable %userprofile% and get the path using the system variable AAInstallationPath ($System:AAInstallationPath$)

 

echo %USERPROFILE%\Downloads > C:\Program Files\Automation Anywhere\Bot Agent\my_path.txt

 

Usually C:\Program Files\Automation Anywhere\Bot Agent is AAInstallationPath whose is accesible by the bot in order to read the path in the file.

 

Regards

 

 

 

 


Hi @Sonny Yuan​ ,

 

If only the Username is dynamic, then you can use the System: Get Environment Variable Action and retrieve the Username.

 

imageThis username can then be placed in the filepath like so:

 

image 

Kind Regards,

Ashwin A.K


Thanks Ashwin! Selected as Best Answer! Very helpful.

Also Raul's solution was useful too!

 


@Sonny Yuan​ - Alternative approach, If you don't want to create additional variable and don't want to add additional line then we can directly pass $SystemVariablesPackage:UserName$ in field. It returns you the same result.


Reply