VbsEdit, the award-winning VBScript editor that dramatically reduces the time you spend writing .VBS scripts

Sample scripts


Storage
   Folders
       List Folders Based on Creation Date , WMI

' List Folders Based on Creation Date


Const LOCAL_TIME = TRUE

Set dtmTargetDate = CreateObject("WbemScripting.SWbemDateTime")
Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime")
dtmTargetDate.SetVarDate "3/1/2004", LOCAL_TIME

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}\\" & strComputer & "\root\cimv2")

Set colFolders = objWMIService.ExecQuery _
    ("Select * from Win32_Directory Where " _
        & "CreationDate > '" & dtmTargetDate & "'")

For each objFolder in colFolders
    dtmConvertedDate.Value = objFolder.CreationDate 
    Wscript.Echo objFolder.Name & VbTab & _
        dtmConvertedDate.GetVarDate(LOCAL_TIME)
Next



VbsEdit includes all these samples!



Download version 3.4.1
Released Tuesday, January 06, 2009  -   The evaluation version never expires


Home   Buy Now   HtaEdit   Support   Video   What's new ?   Awards

Copyright (C) 2001-2009 Adersoft