Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 21st, 2005, 11:13 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Arlington, TX, USA.
Posts: 119
Thanks: 0
Thanked 1 Time in 1 Post
Default FSO question

Does anyone know of a windows utility to check the value in the date modified column in a windows file folder? I want to be able to check that value and determine if I need to send an email to our development staff.

Thanks in advance for any help, suggestions or direction.
Reply With Quote
  #2 (permalink)  
Old February 23rd, 2005, 12:58 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Date Created or Date Modified? I don't know if that object supports Date Modified.

Here is a utility to check date created. I will do research for date modified:

'==========
stPath = InputBox("Type the folder path:")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set stFolder = FSO.GetFolder(stPath)
stDateCreated = stFolder.DateCreated
WScript.Echo stDateCreated
'==========


mmcdonal
Reply With Quote
  #3 (permalink)  
Old February 23rd, 2005, 01:22 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

It does support LastModified, but it is a WMI call, not an FSO call. Here is a start:

'==========
stSQL = "SELECT * FROM Win32_Directory WHERE Name = " & stNewFolder
stComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonat e}!\\" & stComputer & "\root\cimv2")
Set colFolders = objWMIService.ExecQuery(stSQL)
For Each objFolder In colFolders
    WScript.Echo "Last Modified: " & objFolder.LastModified
Next
'==========

The problem is that the user has to type in the full path and then the path needs to look like this:

C:\\Documents and Settings

Not C:\Documents and Settings.

I could write this, but it would take some time and the user would still have to type in the full path. Maybe you can look in VB.Net and see if anyone has done this. I think I will do one to grab all the properties from a folder explorer.

Here are the properties:
Archive
Caption
Compressed
CompressionMethod
CreationDate
Encrypted
EncryptionMethod
Hidden
IsUseCount
LastAccessed
LastModified
Name
Path
Readable
System
Writeable

This probably doesn't help. Sorry.

mmcdonal
Reply With Quote
  #4 (permalink)  
Old February 24th, 2005, 11:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Arlington, TX, USA.
Posts: 119
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks so much for your time and your reply.
Reply With Quote


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help with FSO.GetFile paulnoe Classic ASP Basics 4 December 20th, 2006 06:03 AM
fso error merck_04 .NET Framework 1.x 0 October 18th, 2006 05:53 AM
FSO mikedeepak Classic ASP Databases 5 August 4th, 2004 05:55 AM
FSO mikedeepak Classic ASP Databases 0 August 4th, 2004 12:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.