VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Get the information about a directory using Win32_Directory WMI Class

by Karthikeyan (187 Submissions)
Category: Miscellaneous
Compatability: VB Script
Difficulty: Unknown Difficulty
Originally Published: Thu 29th July 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Get the information about a directory using Win32_Directory WMI Class

Rate Get the information about a directory using Win32_Directory WMI Class



'Generated using 'WMI Win32 Class Autoscript Generator' - Developed by Karthikeyan
'Homepage: http://www.geocities.com/marskarthik

On Error Resume Next
Computer = "."
Set OutFile = CreateObject("WScript.Shell")
Const ForAppending = 2
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set TextFile = FileSystem.OpenTextFile ("c:\Win32_Directory.txt", ForAppending, True)
TextFile.WriteLine "Script for Win32_Directory Class by Karthikeyan"
TextFile.WriteLine 
Set WMIService = GetObject("winmgmts:\\" & Computer & "\root\cimv2")
Set Items = WMIService.ExecQuery("Select * from Win32_Directory where Name='c:\\temp'",,48)
For Each SubItems in Items
TextFile.WriteLine "********************************************************************"
    TextFile.WriteLine "AccessMask: " & SubItems.AccessMask
    TextFile.WriteLine "Archive: " & SubItems.Archive
    TextFile.WriteLine "Caption: " & SubItems.Caption
    TextFile.WriteLine "Compressed: " & SubItems.Compressed
    TextFile.WriteLine "CompressionMethod: " & SubItems.CompressionMethod
    TextFile.WriteLine "CreationClassName: " & SubItems.CreationClassName
    TextFile.WriteLine "CreationDate: " & SubItems.CreationDate
    TextFile.WriteLine "CSCreationClassName: " & SubItems.CSCreationClassName
    TextFile.WriteLine "CSName: " & SubItems.CSName
    TextFile.WriteLine "Description: " & SubItems.Description
    TextFile.WriteLine "Drive: " & SubItems.Drive
    TextFile.WriteLine "EightDotThreeFileName: " & SubItems.EightDotThreeFileName
    TextFile.WriteLine "Encrypted: " & SubItems.Encrypted
    TextFile.WriteLine "EncryptionMethod: " & SubItems.EncryptionMethod
    TextFile.WriteLine "Extension: " & SubItems.Extension
    TextFile.WriteLine "FileName: " & SubItems.FileName
    TextFile.WriteLine "FileSize: " & SubItems.FileSize
    TextFile.WriteLine "FileType: " & SubItems.FileType
    TextFile.WriteLine "FSCreationClassName: " & SubItems.FSCreationClassName
    TextFile.WriteLine "FSName: " & SubItems.FSName
    TextFile.WriteLine "Hidden: " & SubItems.Hidden
    TextFile.WriteLine "InstallDate: " & SubItems.InstallDate
    TextFile.WriteLine "InUseCount: " & SubItems.InUseCount
    TextFile.WriteLine "LastAccessed: " & SubItems.LastAccessed
    TextFile.WriteLine "LastModified: " & SubItems.LastModified
    TextFile.WriteLine "Name: " & SubItems.Name
    TextFile.WriteLine "Path: " & SubItems.Path
    TextFile.WriteLine "Readable: " & SubItems.Readable
    TextFile.WriteLine "Status: " & SubItems.Status
    TextFile.WriteLine "System: " & SubItems.System
    TextFile.WriteLine "Writeable: " & SubItems.Writeable
TextFile.WriteLine "********************************************************************"
Next
TextFile.Close
OutFile.Run "notepad.exe c:\Win32_Directory.txt",1,True


Download this snippet    Add to My Saved Code

Get the information about a directory using Win32_Directory WMI Class Comments

No comments have been posted about Get the information about a directory using Win32_Directory WMI Class. Why not be the first to post a comment about Get the information about a directory using Win32_Directory WMI Class.

Post your comment

Subject:
Message:
0/1000 characters