CommonAppData in vbscript

后端 未结 1 1372
轻奢々
轻奢々 2020-12-31 21:56

A customer\'s application \"AppName\" has its configuration files stored in CommonAppData.

  • Under Windows XP that is C:\\Documents and Settings\\All User
相关标签:
1条回答
  • 2020-12-31 22:32
    Const CommonAppData = &H23&  ' the second & denotes a long integer '
    
    Set objShell  = CreateObject("Shell.Application")
    Set objFolder = objShell.Namespace(CommonAppData)
    
    Set objFolderItem = objFolder.Self
    
    MsgBox objFolderItem.Name & ": " & objFolderItem.Path
    

    The MSDN holds a page that lists the other Shell Special Folder Constants.

    This page is nice, too: Enumerating Special Folders, part of the Microsoft Windows 2000 Scripting Guide. (Link is now defunct, but the Internet Archive still has a copy.)

    0 讨论(0)
提交回复
热议问题