SpecialFolders Property

 

Description

 

Returns a reference to an IWshCollection interface (a collection containing the entire set of Windows special folders, such as the Desktop folder, the Start Menu folder, and the Personal Documents folder).

 

PowerBASIC Syntax

 

PROPERTY GET SpecialFolders () AS IWshCollection

 

Return Value

 

IDispatch. Reference to a IWshCollection interface.

 

Remarks

 

The following table lists special folders along with the version of Windows that supports them.

 

Folder

Windows version

AllUsersDesktop

Windows 2000

AllUsersStartMenu

Windows 2000

AllUsersPrograms

Windows 2000

AllUsersStartup

Windows 2000

Desktop

Windows 98/ME, Windows 2000

Favorites

Windows 98/ME, Windows 2000

Fonts

Windows 98/ME, Windows 2000

My Documents

Windows 98/ME, Windows 2000

NetHood

Windows 98/ME, Windows 2000

PrintHood

Windows 98/ME, Windows 2000

Programs

Windows 98/ME, Windows 2000

Recent

Windows 98/ME, Windows 2000

SendTo

Windows 98/ME, Windows 2000

Start Menu

Windows 98/ME, Windows 2000

StartupB

Windows 2000

Templates

Windows 2000

 

Example [PowerBASIC]

 

#INCLUDE "WSHOM.INC"

 

DIM pWsh AS IWshShell

DIM pSpecialFolders AS IWshCollection

DIM nCount AS LONG

DIM i AS LONG

DIM vItem AS VARIANT

DIM vValue AS VARIANT

 

pWsh = NEWCOM "WScript.Shell"

' Get a reference to the special folders collection

pSpecialFolders = pWsh.SpecialFolders

 

' Get the number of objects in the collection

nCount = pSpecialFolders.Count

 

' Enumerates the collection

FOR i = 0 TO nCount - 1

   vItem = i AS LONG

   vValue = pSpecialFolders.Item(vItem)

   IF OBJRESULT THEN EXIT FOR

   STDOUT VARIANT$(vValue)

NEXT

 

Valid XHTML 1.0 Transitional