-
Notifications
You must be signed in to change notification settings - Fork 338
/
Copy pathSpecialFolders.rvb
43 lines (40 loc) · 1.7 KB
/
SpecialFolders.rvb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' SpecialFolder.rvb -- September 2007
' If this code works, it was written by Dale Fugier.
' If not, I don't know who wrote it.
' Works with Rhino 4.0.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' AllUsersAppDataFolder
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function AllUsersAppDataFolder
Const ALL_USERS_APPDATA = &H23&
Dim objShell, objFolder, objFolderItem
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(ALL_USERS_APPDATA)
Set objFolderItem = objFolder.Self
AllUsersAppDataFolder = objFolderItem.Path
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' LocalUserAppDataFolder
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function LocalUserAppDataFolder
Const LOCAL_APPDATA = &H1c&
Dim objShell, objFolder, objFolderItem
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(LOCAL_APPDATA)
Set objFolderItem = objFolder.Self
LocalUserAppDataFolder = objFolderItem.Path
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' AppDataFolder
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function AppDataFolder
Const APPDATA = &H1a&
Dim objShell, objFolder, objFolderItem
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(APPDATA)
Set objFolderItem = objFolder.Self
AppDataFolder = objFolderItem.Path
End Function