Code Script .co.uk

Home | Scripts | Tutorials | Disclaimer | Sitemap | Contact

   Windows File Locations
 

Vbscript / Files And Folders / Windows File Locations

The variables below can be used to access the Windows folder locations.


Const LOCAL_SETTINGS_HISTORY = &H22&
Const MY_PICTURES = &H27&
Const MY_RECENT_DOCUMENTS = &H8&
Const MY_COMPUTER = &H11&
Const NETHOOD = &H13&
Const PROGRAMS = &H2&
Const PROGRAM_FILES = &H26&
Const RECYCLE_BIN = &Ha&
Const SYSTEM32 = &H25&
Const STARTUP = &H7&
Const START_MENU = &Hb&
Const ADMINISTRATIVE_TOOLS = &H2f&
Const ALL_USERS_APPLICATION_DATA = &H23&
Const ALL_USERS_DESKTOP = &H19&
Const ALL_USERS_PROGRAMS = &H17&
Const ALL_USERS_START_MENU = &H16&
Const ALL_USERS_STARTUP = &H18&
Const APPLICATION_DATA = &H1a&
Const SENDTO = &H9&
Const COMMON_FILES = &H2b&
Const CONTROL_PANEL = &H3&
Const DESKTOP = &H10&
Const FONTS = &H14&
Const COOKIES = &H21&
Const FAVORITES = &H6&
Const LOCAL_APPLICATION_DATA = &H1c&
Const MY_NETWORK_PLACES = &H12&
Const MY_DOCUMENTS = &H5&
Const MY_MUSIC = &Hd&
Const NETWORK_CONNECTIONS = &H31&
Const PRINTERS_AND_FAXES = &H4&
Const PRINTHOOD = &H1b&
Const MY_VIDEOS = &He&
Const TEMPLATES = &H15&
Const TEMPORARY_INTERNET_FILES = &H20&
Const USER_PROFILE = &H28&
Const WINDOWS = &H24&
Const INTERNET_EXPLORER = &H1&

Use the folder locations with the Shell.Application object as shown below:

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(MY_DOCUMENTS)
Set objFolderItem = objFolder.Self
Wscript.Echo objFolderItem.Path





Please note that a disclaimer applies to any code on this page.

 
   Actions
  Go Back
  Bookmark
  Print Page


   Menu
 
- Links
- Reference
- Script Editors
- Tutorials
- Vbscript
     - Active Directory
     - Exchange
     - Files And Folders
          - Auto Copy Files From Cdrom
          - Backup My Documents
          - Cleanup Filenames
          - Create Remote File Share
          - File Properties
          - File Server Report
          - File Type Report Scan
          - Find And Replace Filename Text
          - Find And Replace Text In Files
          - Folder Size Scanner
          - Rename Files Find And Remove Text
          - Rename Files Find And Replace Text
          - Replace Folder Ntfs Security Permissions
          - Simple File Report
          - Sort And Move Files To Folders
          - Windows File Locations
     - General
     - Ms Office
     - Operating System
     - Processes And Services
     - Text Processing
     - User Interaction
     - Web Servers


Keywords: windows folders, path constants, folder path,