件夹、开始菜单文件夹和个人文档文件夹。
语法
WshShell.SpecialFolders = objWshSpecialFolders
示例
' This code fragment shows how to access the desktop folder
Set WshShell = Wscript.CreateObject("Wscript.Shell")
MsgBox "Your desktop is " & WshShell.SpecialFolders("Desktop")
请参阅
WshSpecialFolders 对象
WshSpecialFolders 对象
该对象未直接给出。要得到 WshSpecialFolders 对象,请使用 WshShell.SpecialFolders 属性。
ProgID N/A
文件名 WSHom.Ocx
CLSID
IID
下表描述与 WshSpecialFolders 对象关联的属性。
属性 描述
Item 指定文件夹的完整路径(默认)。
Count 枚举项的数目。
length 枚举项的数目 (JScript) 。
WshSpecialFolders.Item
Item 属性返回由 strFolderName 指定的文件夹的完整路径。它是默认属性。
语法
WshShell.SpecialFolders.Item("strFolderName") = strFolderPath
WshShell.SpecialFolders("strFolderName") = strFolderPath
注释
若请求的文件夹 (strFolderName) 不可用,则 WshShell.SpecialFolders("strFolderName") 返回 NULL。例如,Windows 95 没有 AllUsersDesktop 文件夹,如果 strFolderName = AllUsersDesktop,则返回 NULL。
Windows 95 和 Windows NT 4.0 操作系统提供下列指定文件夹:
AllUsersDesktop
AllUsersStartMenu
AllUsersPrograms
AllUsersStartup
Desktop
Favorites
Fonts
MyDocuments
NetHood
PrintHood
Programs
Recent
SendTo
StartMenu
Startup
Templates
示例
' This fragment returns the full path for the Windows Desktop folder
Set WshShell = Wscript.CreateObject("Wscript.Shell")
&nbs
语法
WshShell.SpecialFolders = objWshSpecialFolders
示例
' This code fragment shows how to access the desktop folder
Set WshShell = Wscript.CreateObject("Wscript.Shell")
MsgBox "Your desktop is " & WshShell.SpecialFolders("Desktop")
请参阅
WshSpecialFolders 对象
WshSpecialFolders 对象
该对象未直接给出。要得到 WshSpecialFolders 对象,请使用 WshShell.SpecialFolders 属性。
ProgID N/A
文件名 WSHom.Ocx
CLSID
IID
下表描述与 WshSpecialFolders 对象关联的属性。
属性 描述
Item 指定文件夹的完整路径(默认)。
Count 枚举项的数目。
length 枚举项的数目 (JScript) 。
WshSpecialFolders.Item
Item 属性返回由 strFolderName 指定的文件夹的完整路径。它是默认属性。
语法
WshShell.SpecialFolders.Item("strFolderName") = strFolderPath
WshShell.SpecialFolders("strFolderName") = strFolderPath
注释
若请求的文件夹 (strFolderName) 不可用,则 WshShell.SpecialFolders("strFolderName") 返回 NULL。例如,Windows 95 没有 AllUsersDesktop 文件夹,如果 strFolderName = AllUsersDesktop,则返回 NULL。
Windows 95 和 Windows NT 4.0 操作系统提供下列指定文件夹:
AllUsersDesktop
AllUsersStartMenu
AllUsersPrograms
AllUsersStartup
Desktop
Favorites
Fonts
MyDocuments
NetHood
PrintHood
Programs
Recent
SendTo
StartMenu
Startup
Templates
示例
' This fragment returns the full path for the Windows Desktop folder
Set WshShell = Wscript.CreateObject("Wscript.Shell")
&nbs