Location of the documents folder

Location of the documents folder

GeeHaa
Collaborator Collaborator
1,081 Views
3 Replies
Message 1 of 4

Location of the documents folder

GeeHaa
Collaborator
Collaborator

Hi 

I'm used to finding the documents folder with (strcat (getenv "USERPROFILE") "\\documents\\") but now onedrive is in the way. Is there a method to find the (absolute) documents folder with autolisp? I know there is with VB.net.

 

Thanks,

 

G.

0 Likes
Accepted solutions (1)
1,082 Views
3 Replies
Replies (3)
Message 2 of 4

pendean
Community Legend
Community Legend
>>>...but now onedrive is in the way...<<<
Please elaborate.
0 Likes
Message 3 of 4

GeeHaa
Collaborator
Collaborator

(strcat (getenv "USERPROFILE")"\\OneDrive - XXXX\\documents\\") Not everyone has one drive and they all have slightly different names. This is what I use to find it in VB.net. Environment.SpecialFolder.MyDocuments.

 

Thanks

0 Likes
Message 4 of 4

ronjonp
Advisor
Advisor
Accepted solution

Maybe one of the methods HERE.

 

Here are a couple that stand out:

(getvar 'MYDOCUMENTSPREFIX)

(vl-registry-read "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" "Personal")