Re: OT: VB Assistance please Jim :-)

Hehe, sorry cismic...

Not as elegant, but I managed to hack around the following to convert my
current date to UTC, and then use this in my Select statement...
=============================================
strComputer = "."
Set objSWbemServices = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colTimeZone = objSWbemServices.ExecQuery _
    ("SELECT * FROM Win32_TimeZone")
For Each objTimeZone in colTimeZone
    strBias = objTimeZone.Bias
Next

dtmCurrentDate = "09/07/2004"
dtmTargetDate = Year(dtmCurrentDate)

dtmMonth = Month(dtmCurrentDate)
If Len(dtmMonth) = 1 Then
    dtmMonth = "0" & dtmMonth
End If

dtmTargetDate = dtmTargetDate & dtmMonth

dtmDay = Day(dtmCurrentDate)
If Len(dtmDay) = 1 Then
    dtmDay = "0" & dtmDay
End If

dtmTargetDate = dtmTargetDate & dtmDay & "000000.000000" 
dtmTargetDate = dtmTargetDate & Cstr(strBias)
wScript.Echo dtmTargetDate
=============================================

and then
=============================================
strQuery="Select Name,CreationDate,LastAccessed,LastModified," & _
"FileSize,Extension,Drive FROM CIM_DATAFILE WHERE Drive='e:' and
LastModified > '" & dtmtargetDate & "'"
=============================================

Thanks guys, always a pleasure!!!!!!

-----Original Message-----
From: Jim Harrison [mailto:jim@xxxxxxxxxxxx] 
Sent: 09 July 2004 06:38 PM
To: [ISAserver.org Discussion List]
Subject: [isalist] Re: OT: VB Assistance please Jim :-)

http://www.ISAserver.org

It's not in VBScript, but you can look into
http://isatools.org/isainfo/isainfo.js to see howone way to construct an
acceptable date 
limiter for WMI.
Specifically, "GetEvtLogData" function is where you'll find it.
Also, Joseph has shown hisownself to be quite the scripting dewd; I'm sure
he's feeling all downhearted 'n stuff about being so 
obviously ignored in your request ...
;-)

 Jim Harrison
 MCP(NT4, W2K), A+, Network+, PCG
 http://www.microsoft.com/isaserver
 http://isaserver.org/Jim_Harrison
 http://isatools.org

 Read the help, books and articles!
----- Original Message ----- 
From: "William Robertson" <robertson.william@xxxxxxxxxxxxxx>
To: "[ISAserver.org Discussion List]" <isalist@xxxxxxxxxxxxx>
Sent: Friday, July 09, 2004 09:28
Subject: [isalist] OT: VB Assistance please Jim :-)


http://www.ISAserver.org

Hi Jim

Apologies for intruding on the list for your reply, but I'm dead sure many
people may find your reply useful, being the VB boff that you are ;-)

I have a VB Script in which I am trying to locate all files on a server that
have been modified since a certain time and date. The crux of my query is as
follows:

strQuery="Select Name,LastModified,FileSize FROM CIM_DATAFILE WHERE
Drive='c:'"

What I would love to do is include the following "where" clause to find
files modified since 09 July 2004 at 10:00:00am:
" where Left(LastModified,10) > 20040907100000"

Obviously the above doesn't work though, so I was wondering if you might be
able to shed some light on the matter for me?

TIA
William R.


---------------------------------------------------------------------
Everything in this e-mail and attachments relating to the official
business of Columbus Stainless is proprietary to the company. It is
confidential, legally privileged and protected by law. Columbus
Stainless does not own and endorse any other content. Views and
opinions are those of the sender unless clearly stated as being that
of Columbus Stainless. The person addressed in the e-mail is the sole
authorised recipient.  Please notify the sender immediately if it has
unintentionally reached you and do not read, disclose or use the
content in any way. Whilst all reasonable steps are taken to ensure
the accuracy and integrity of information and data transmitted
electronically and to preserve the confidentiality thereof, no
liability or responsibility whatsoever is accepted if information or
data is,for whatever reason, corrupted or does not reach its intended
destination.
---------------------------------------------------------------------

------------------------------------------------------
List Archives: http://www.webelists.com/cgi/lyris.pl?enter=isalist
ISA Server Newsletter: http://www.isaserver.org/pages/newsletter.asp
ISA Server FAQ: http://www.isaserver.org/pages/larticle.asp?type=FAQ
------------------------------------------------------
Other Internet Software Marketing Sites:
World of Windows Networking: http://www.windowsnetworking.com
Leading Network Software Directory: http://www.serverfiles.com
No.1 Exchange Server Resource Site: http://www.msexchange.org
Windows Security Resource Site: http://www.windowsecurity.com/
Network Security Library: http://www.secinf.net/
Windows 2000/NT Fax Solutions: http://www.ntfaxfaq.com
------------------------------------------------------
You are currently subscribed to this ISAserver.org Discussion List as:
jim@xxxxxxxxxxxx
To unsubscribe visit http://www.webelists.com/cgi/lyris.pl?enter=isalist


------------------------------------------------------
List Archives: http://www.webelists.com/cgi/lyris.pl?enter=isalist
ISA Server Newsletter: http://www.isaserver.org/pages/newsletter.asp
ISA Server FAQ: http://www.isaserver.org/pages/larticle.asp?type=FAQ
------------------------------------------------------
Other Internet Software Marketing Sites:
World of Windows Networking: http://www.windowsnetworking.com
Leading Network Software Directory: http://www.serverfiles.com
No.1 Exchange Server Resource Site: http://www.msexchange.org
Windows Security Resource Site: http://www.windowsecurity.com/
Network Security Library: http://www.secinf.net/
Windows 2000/NT Fax Solutions: http://www.ntfaxfaq.com
------------------------------------------------------
You are currently subscribed to this ISAserver.org Discussion List as:
robertson.william@xxxxxxxxxxxxxx
To unsubscribe visit http://www.webelists.com/cgi/lyris.pl?enter=isalist

---------------------------------------------------------------------
Everything in this e-mail and attachments relating to the official 
business of Columbus Stainless is proprietary to the company. It is 
confidential, legally privileged and protected by law. Columbus 
Stainless does not own and endorse any other content. Views and 
opinions are those of the sender unless clearly stated as being that 
of Columbus Stainless. The person addressed in the e-mail is the sole 
authorised recipient.  Please notify the sender immediately if it has 
unintentionally reached you and do not read, disclose or use the 
content in any way. Whilst all reasonable steps are taken to ensure 
the accuracy and integrity of information and data transmitted 
electronically and to preserve the confidentiality thereof, no 
liability or responsibility whatsoever is accepted if information or 
data is,for whatever reason, corrupted or does not reach its intended
destination.
---------------------------------------------------------------------


Other related posts: