Jump to content

Recommended Posts

Posted

I log all logins in to a text file purely to make it easier on myself when I need to find where someone has logged in. I didn't notice the change until a few days afterwards and it took me a few days to work out exactly what I had done that made this change - I'm still not sure WHY it made this change.

To see an example of the format of the text file I log to please see the code snippet below;

 Set WshNetwork = WScript.CreateObject("WScript.Network") 
msgbox(ucase(WshNetwork.ComputerName) & "	" & lcase(WshNetwork.UserName) & "	" & WeekdayName(Weekday(Date)) & "	" & Date & "	" & Time) 

 

The first example here is with SP3 installed;

mypc       myusername   Thursday        7/10/2008       1:00:35 PM

This example here is after uninstalling SP3;

mypc       myusername   Thursday        10/07/2008      13:19:20

 

So SP3 seems to americanize the date and time?

 

I have no idea why this change happened, as far as I can tell there were no changes at all to Regional/Locale options and I don't see reference in the SP3 notes for such a change either.

I was looking to deploy SP3 this summer with SCCM (SMS Successor for those that are not aware) but I am not happy about this change.

 

Anyone have any ideas? or anyone noticed any other anomalies with SP3?

Posted

I have SP3 installed on my machine here - not rolled it out in the school yet, but copying your script to a VBS file to test I do not get the same results as you. My time is in 24 hour format (but I do not have a previous to compare to) but my date has remained in UK format - ie it is showing 11/07/2008.

 

If you check your "Regional and Language Options" in the control panel, does it still show your preferred date formats correctly?

Posted

Interesting!

How did you install SP3? from Windows Update?

 

Yes Regional & Language Options show date formats exactly how I expect them to be shown, they just don't get shown that way!

I see the same incorrect format using net time too

Posted (edited)

Try adding

 

SetLocale(2057)

 

to the start of your VBScript (assuming you're in the UK)

 

Used to be a problem with ASP pages etc when something went quirky. Seems to be compounded in SP3 - but forcing the locale in the script should fix it.

 

Edit - after a bit of trawling, check out the MS KB article Script output is not displayed as expected when you run VBScript or JScript scripts in Windows Vista Service Pack 1, in Windows Server 2008, or in Windows XP Service Pack 3. Hotfix on the way apparently - but their workaround is the same, just use setlocale for the moment.

Edited by OutToLunch
Add MS KB link
Posted

The other thing to do is to force the date you write to the file to be in a "universal" format - something like:

 

ofile.writeline year(now) & "-" & right("0" & month(now),2) & "-" & right("0" & day(now),2) & " " & right("0" & hour(now),2) & ":" & right("0" & minute(now),2)

- gives things like "2008-07-11 12:10" which is easy to work with (you can insert it into spreadsheets and databases in any regional format and it will be "right")

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...