Skip to main content
Question

how to access files in c:\user\username\downloads folder?

  • November 14, 2022
  • 4 replies
  • 981 views

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,

4 replies

Raul Jaimes
Forum|alt.badge.img+9
  • Navigator | Tier 3
  • November 15, 2022

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

 

 

 

 


Ashwin A.K
Forum|alt.badge.img+10
  • Navigator | Tier 3
  • November 15, 2022

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


  • Author
  • Navigator | Tier 3
  • November 15, 2022

Thanks Ashwin! Selected as Best Answer! Very helpful.

Also Raul's solution was useful too!

 


Forum|alt.badge.img+6
  • Navigator | Tier 3
  • November 15, 2022

@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.