I should have also noted that the tide is flooding and thus I am not
planning to set sail today but will wait for the ebb tomorrow morning.
-dave
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David R. Cattley
Sent: Monday, March 30, 2009 10:12 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] inf2cat - postdated DriverVer not allowed
James,
How long would it take to write a C program that returns the current time as
UCT printed out as in the string format required for STAMPINF_DATE
environment variable and used in a batch file like below?
How long would it take to write a VBScript that does this or simply invokes
stampinf with the necessary twiddling?
I am sure you could become the new best friend of most every driver-writer
in your hemisphere by posting the ~30 lines or so of code back to the list

My favorite trick for doing crazy stuff like this is to write a VBScript
that I invoke ‘inline’ in makefile.inc which generates a file then included
into the makefile.inc.
!if [cscript now.vbs > $(O)\now.inc]
!endif
!if exists( $(O)\now.inc )
!include “$(O)\now.inc”
And of course now.vbs (or now.exe or whatever) ought to emit a text string
to stdout that is of the form:
STAPMINF_DATE=
And viola’ you will have your variable defined in your makefile.inc and if
you really want it in a batch file you can (I am sure) easily do that too.
And now.vbs could be something about as complex as:
Set oShell = CreateObject(“WScript.Shell”)
tzBias = oShell.RegRead(
“HKEY_LOCAL_MACHINE\System\CurrentControlSet”&
“\Control\TimeZoneInformation\ActiveTimeBias”_
)
tmNowUTC = DateAdd(“n”, tzBias, now())
WScript.Echo "# " & tmNowUTC
WScript.Echo “STAMPINF_DATE=” & FormatDateTime(tmNowUTC, 2)
Which run at the time I am posting this message outputs
# 3/30/2009 2:07:32 PM
STAMPINF_DATE=3/30/2009
I quick check against the Admiralty cannon boom tells me that it is indeed
mid afternoon on the 30th at the prime meridian.
Good Luck,
Dave Cattley
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of James Harper
Sent: Sunday, March 29, 2009 10:53 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] inf2cat - postdated DriverVer not allowed
>
> Ah yes of course,
>
> the only way I have found to workaround it totally in a batch file is
> something like this:
>
> ::set timezone to UTC
> control.exe timedate.cpl,/Z Greenwich Standard Time
> ::set the STAMPINF_DATE environment variable
> For /f "tokens=2-4 delims=/ " %%a in (‘date /t’) do (set
> STAMPINF_DATE=%%a/%%b/%%c)
> ::set timezone back to NZ
> control.exe timedate.cpl,/Z New Zealand Standard Time
>
Interesting. That may be acceptable for a dedicated build machine, but
could cause problems if I tried it on my laptop…
Does NZ have daylight savings time? Does the above ‘just work’ in that
case?
Thanks
James
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer