Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
|
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 November 4th, 2004, 03:20 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default Folder CreationDate Property

Hi,

   I am trying to access the creationdate property of a folder. Currently I have a script that reports all users who have logged into a machine like this...

Set FSO = CreateObject("Scripting.FileSystemObject")
ShowSubFolders FSO.GetFolder("C:\Documents and Settings\")
Sub ShowSubFolders(Folder)
    For Each SubFolder In Folder.SubFolders
        strDocArray = SubFolder.Path
        NewArray = Split(strDocArray, "\")
        strLogin = NewArray(2)
        objRecordset.AddNew
        objRecordset("Key") = xxx
        objRecordset("ComputerName") = strComputerName
        objRecordset("Login") = strLogin
        objRecordset("Date") = xxx
        objRecordset("Time") = xxx
        objRecordset.Update
    Next
End Sub

   This accesses all the folders in the documents and settings folder structure and passes the user names from those folders.

   I want to get the creationdate of those same folders. Do I do something like:

   strCreateDate = SubFolder.CreationDate

I have another script that gets the path and screation date, but it does every folder on the computer. That is too much of course.

Thanks,


mmcdonal
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com
Reply With Quote
  #2 (permalink)  
Old November 4th, 2004, 04:31 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

In case anyone is reading this thread, I found the answer. It is not CreationDate as in VB, but...

strDate = SubFolder.DateCreated

mmcdonal
Reply With Quote
  #3 (permalink)  
Old November 4th, 2004, 05:09 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Here you go - DateCreated Property

There are other properties listed on the left, that should be useful to you.

Cheers!

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #4 (permalink)  
Old November 5th, 2004, 12:07 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Refinement:
As an example, this property returns:
"2/13/2004 1:52:39 PM"

To make sure I get just the date, I used this code:

DateArray = Split(SubFolder.DateCreated, " ")
strCreate = DateArray(0)

This method uses the " " space to create array elements, and then I just take the first element (0) as my value. I pass this to the database.

mmcdonal
Reply With Quote
  #5 (permalink)  
Old November 8th, 2004, 12:03 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

So you don't need the time part there? Just the date on which it was created would do? Then fine that was right.

Cheers!

_________________________
- Vijay G
Strive for Perfection
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
property umeshtheone Beginning VB 6 2 May 18th, 2007 12:37 AM
App_Code folder shared on only 1 folder? rpeters83 ASP.NET 2.0 Professional 1 September 1st, 2006 10:53 PM
Making a folder virtual folder on button click in CsharpHelp C# 0 October 26th, 2005 05:57 AM
images folder Lee jonesy Dreamweaver (all versions) 7 September 12th, 2004 01:35 PM
Get Folder names Jaco Jordaan ASP.NET 1.0 and 1.1 Basics 2 October 29th, 2003 12:04 PM





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