My.SpecialFolders

My.SpecialFolders is very easy to use. Add the item template to your project, and start typing My.Computer. where you need a directory to be declared. As soon as you type that last period, the regular My.Computer options will come up, as well as several folder names (for example, Cookies or DesktopDirectory). Double-click the one that you want, and it will be added into your code. So, to get the path of your Cookies folder, you would type My.Computer.Cookies .

To make sure it works, double-click your form to access its Load() event handler. Then, type MsgBox(My.Computer.Cookies) . When you run your application, you should see a message box pop up with the path to your Cookies folder.

Folders included in the latest version:
  • Cookies
  • Favorites
  • Application Data
  • Common Application Data
  • Common Program Files
  • Desktop (Virtual folder)
  • Desktop (Directory)
  • History
  • Temporary Internet Files
  • Local Application Data
  • My Documents (XP) / Documents (Vista, 7)
  • My Pictures (XP) / Pictures (Vista, 7)
  • My Music (XP) / Music (Vista, 7)
  • My Videos (XP) / Videos (Vista, 7) New!
  • Personal Files (Actually returns the Documents folder)
  • Program Files (Usually C:\Program Files)
  • Programs
  • Recent Documents
  • Send To
  • Start Menu
  • Startup Folder (Place shortcuts here for them to run when your computer starts)
  • System Root Folder (Usually C:\Windows\System32)
  • Templates
  • Hard Drive (Returns the letter of the current drive)
  • Windows directory
  • Prefetch folder
  • Downloads
  • Program Files (x86) New!
  • Common Program Files (x86) New!
  • User folder New!
  • Public folder New!

Last edited Jun 4, 2012 at 2:51 PM by drummerboy0511, version 4

Comments

No comments yet.