Code Script .co.uk

Home | Scripts | Tutorials | Disclaimer | Sitemap | Contact

   File Properties
 

Vbscript / Files And Folders / File Properties

Script showing how to retrieve file properties.


strFile = Wscript.ScriptName


Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(strFile)

strProp = "File Properties: " & strFile & vbLF & vbLF

strProp= strProp & "Name: " & objFile.Name & vbLF
strProp= strProp & "On Drive: " & objFile.Drive & vbLF
strProp = strProp & "Parent Folder: " & objFile.ParentFolder & vbLF
strProp = strProp & "Full Path: " & objFile.Path & vbLF & vbLF
strProp = strProp & "FileVersion: " & objFSO.GetFileVersion(strFile) & vbLF
strProp = strProp & "Size: " & objFile.Size & " B" & vbLF & vbLF
strProp = strProp & "Date Created: " & objFile.DateCreated & vbLF
strProp = strProp & "Last Accessed: " & objFile.DateLastAccessed & vbLF
strProp = strProp & "Last Modified: " & objFile.DateLastModified & vbLF

Wscript.Echo strProp





Please note that a disclaimer applies to any code on this page.
 
   Actions
  Go Back
  Bookmark
  Print Page


   Menu
 
- Links
- Reference
- Script Editors
- Tutorials
- Vbscript
     - Active Directory
     - Exchange
     - Files And Folders
          - Auto Copy Files From Cdrom
          - Backup My Documents
          - Cleanup Filenames
          - Create Remote File Share
          - File Properties
          - File Server Report
          - File Type Report Scan
          - Find And Replace Filename Text
          - Find And Replace Text In Files
          - Folder Size Scanner
          - Rename Files Find And Remove Text
          - Rename Files Find And Replace Text
          - Replace Folder Ntfs Security Permissions
          - Simple File Report
          - Sort And Move Files To Folders
          - Windows File Locations
     - General
     - Ms Office
     - Operating System
     - Processes And Services
     - Text Processing
     - User Interaction
     - Web Servers