GetSpecialFolder Method

 

Description

 

Returns the special folder object specified.

 

PowerBASIC Syntax

 

METHOD GetSpecialFolder ( _

BYVAL bstrFolderSpec AS STRING _

) AS IFolder

 

Arguments

 

bstrFolderSpec

BSTR. The name of the special folder to be returned. Can be any of the constants shown in the Settings section.

 

Return Value

 

IDispatch. Reference to a IFolder interface.

 

Settings

 

The bstrFolderSpec argument can have any of the following values:

 

Constant

Value

Description

WindowsFolder

0

The Windows folder contains files installed by the Windows operating system.

SystemFolder

1

The System folder contains libraries, fonts, and device drivers.

TemporaryFolder

2

The Temp folder is used to store temporary files. Its path is found in the TMP environment variable.

 

Example [PowerBASIC]

 

#INCLUDE "windows.inc"

#INCLUDE "scrrun.inc"

 

DIM fso AS IFileSystem

DIM strName AS STRING

 

' Create an instance of the FileSystemObject

fso = NEWCOM "Scripting.FileSystemObject"

' Get the name of an special folder

strName = fso.GetSpecialFolderName (%SpecialFolder_WindowsFolder)

 

Valid XHTML 1.0 Transitional