Folder.ParentFolder プロパティ

Folder オブジェクトを格納します。

このプロパティは読み取り専用です。

構文

ParentFolder = Folder.ParentFolder

プロパティ値

ParentFolder オブジェクトへのオブジェクト参照。

注釈

Note

すべてのフォルダーに対してすべてのメソッドが実装されているわけではありません。 たとえば、parseName メソッドは、コントロール パネル フォルダー (CSIDL_CONTROLS) には実装されていません。 実装されていないメソッドを呼び出そうとすると、0x800A01BD (10 進数 445) エラーが発生します。

 

次の例は、JScript、VBScript、Visual Basic の ParentFolder の適切な使用方法を示しています。

Jscript:

<script language="JScript">
    function fnFolderParentFolderJ()
    {
        var objShell    = new ActiveXObject("shell.application");
        var objFolder;
        var ssfPROGRAMS = 2;
        
        objFolder = objShell.NameSpace(ssfPROGRAMS);
        if (objFolder != null)
        {
            var objParentFolder;
                
            objParentFolder = objFolder.ParentFolder;
            if (objParentFolder != null)
            {
                alert(objParentFolder.Title);
            }
        }
    }
</script>

Vbscript:

<script language="VBScript">
    function fnFolderParentFolderVB()
        dim objShell
        
        set objShell = CreateObject("shell.application")
        if (not objShell is nothing) then
            dim objFolder
            dim ssfPROGRAMS
            
            ssfPROGRAMS = 2
            set objFolder = objShell.NameSpace(ssfPROGRAMS)
            if (not objFolder is nothing) then
                dim objParentFolder
                        
                set objParentFolder = objFolder.ParentFolder
                if (not objParentFolder is nothing) then
                    alert(objParentFolder.Title)
                end if
                set objParentFolder = nothing
            end if
            set objFolder = nothing
        end if
        set objShell = nothing
    end function
 </script>

Visual Basic:

Private Sub fnFolderParentFolderVB()
    Dim objShell    As Shell
    Dim objFolder   As Folder
    Dim ssfPROGRAMS As Long
            
    ssfPROGRAMS = 2
    Set objShell = New Shell
    Set objFolder = objShell.NameSpace(ssfPROGRAMS)
    If (Not objFolder Is Nothing) Then
        Dim objParentFolder As Folder
                
        Set objParentFolder = objFolder.ParentFolder
        If (Not objParentFolder Is Nothing) Then
            Debug.Print objParentFolder.Title
        End If
        Set objParentFolder = Nothing
    End If
    Set objFolder = Nothing
    Set objShell = Nothing
End Sub

要件

要件
サポートされている最小のクライアント
Windows 2000 Professional、Windows XP [デスクトップ アプリのみ]
サポートされている最小のサーバー
Windows 2000 Server [デスクトップ アプリのみ]
ヘッダー
Shldisp.h
IDL
Shldisp.idl
[DLL]
Shell32.dll (バージョン 4.71 以降)