Desdichado
Limp Gawd
- Joined
- Apr 22, 2006
- Messages
- 331
I'm in a situation where I have a program that I have to use that has trouble with dates after 2000. I was wondering if there was an easy way to write a .vbs to change the date to a specific date (say, today's date, 1999). I know this should be easy, and I've used vb scripts quite a bit, but I can't figure out how to actually make it work.
this is what I've been trying. It outputs the correct date, but nothing happens to the windows date-time.
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For Each objItem in colItems
objItem.LocalDateTime = "19991215232705.171000-300"
wscript.echo objItem.LocalDateTime
Next
this is what I've been trying. It outputs the correct date, but nothing happens to the windows date-time.
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For Each objItem in colItems
objItem.LocalDateTime = "19991215232705.171000-300"
wscript.echo objItem.LocalDateTime
Next