@SHFOLDER[n] : Returns the full pathname for the specified Windows folder (which vary in different versions of Windows and if the user has altered the defaults).

 

n is a number from 0 to 59 that returns the following values:

 
0 - Desktop
2 - Start Menu\Programs
5 - My Documents
6 - <user name>\Favorites
7 - Start Menu\Programs\Startup
8 - <user name>\Recent
9 - <user name>\SendTo
11 - <user name>\Start Menu
13 - "My Music" folder
14 - "My Videos" folder
16 - <user name>\Desktop
19 - <user name>\nethood
20 - windows\fonts
21 - templates
22 - All Users\Start Menu
23 - All Users\Start Menu\Programs
24 - All Users\Startup
25 - All Users\Desktop
26 - <user name>\Application Data
27 - <user name>\PrintHood
28 - <user name>\Local Settings\Application Data (non roaming)
29 - non localized startup
30 - non localized common startup
31 - common favorites
32 - Internet cache
33 - cookies
34 - history
35 - All Users\Application Data
36 - Windows directory
37 - Windows system directory
38 - Program Files
39 - <user name>\My Pictures
40 - USERPROFILE
41 - X86 system directory on x64
42 - x86 c:\Program Files on x64
43 - c:\Program Files\Common
44 - x86 Program Files\Common on x64
45 - All Users\Templates
46 - All Users\Documents
47 - All Users\Start Menu\Programs\Administrative Tools
48 - <user name>\Start Menu\Programs\Administrative Tools
53 - All Users\My Music
54 - All Users\My Pictures
55 - All Users\My Video
56 - Resource Directory
59 - USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning

 

Examples:

 

echo %@shfolder[42]

C:\Program Files (x86)

 

echo %@shfolder[22]

C:\ProgramData\Microsoft\Windows\Start Menu