mint
(Mintoo)
May 27, 2024, 4:04am
1
hi ,
i developed a process to download a file from sharepoint
i gave the path as c:\users\environment.username\document\SharePoint\fileName on local
SharePoint FOLDER I CREATED under documents on vm
its working fine ON LOCAL
how make this work on robot as its failing with error cannot find path
c:\users\LOCAL SERVICES\document\SharePoint\fileName
@mint ,
Use this in assign activity:
"c:\users\"+Environment.UserName+"\document\SharePoint\fileName"
Environment.UserName will give you user name.
Thanks,
Ashok
mint
(Mintoo)
May 27, 2024, 6:05am
3
@ashokkarale Thanks i used Envirnment.username but its failing
seems there is some change as when i am executing the script its coming as NT AUTHORITY\LOCAL SERVICE as host identity
mint
(Mintoo)
May 27, 2024, 6:10am
5
yes it is background automation
Anil_G
(Anil Gorthi)
May 27, 2024, 6:55am
6
@mint
background automations by default run under local host so the username would be local users as you are getting in environment.Username
in this scenario use generic locations like c:\Botfolder\
which you can check and create if not available in the process itself
cheers
mint
(Mintoo)
May 27, 2024, 7:12am
7
@Anil_G should i create a folder under c: drive asshare point folder and then will i will be able to download and add that file as an attachment ?
Anil_G
(Anil Gorthi)
May 27, 2024, 7:14am
8
@mint
if you just need to download and attach…then better use Path.Combine(environment.CurrentDirectory,"Filename")
even the same thing can be done using c drive folder as well.
then you can attach from there as well
cheers
1 Like
system
(system)
Closed
June 3, 2024, 11:50am
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.