Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Help /w system api call to change regional setting

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,24
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Help /w system api call to change regional setting
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Help /w system api call to change regional setting - 5/23/2001 3:17:59 AM   
  snoorkle29

 

Posts: 1
Score: 0
Joined: 5/23/2001
From: USA
Status: offline
i'm a newbe to vbscripting.

My problem is that a network of computers need to change some settings without going to each computer manually. here is the code to do it in vb, but how can i get this to work if the network sysop doesn't want unfamilier executables running? Can it be done in vbscript?

Here is some code that changes the regional settings through api calls in visual basic:

'********************************************************
Private Const LOCALE_SSHORTDATE = &H1F
Private Const WM_SETTINGCHANGE = &H1A
Private Const HWND_BROADCAST = &HFFFF&

Private Declare Function SetLocaleInfo Lib "kernel32" Alias "SetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String) As Boolean

Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Private Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long


Public Sub ConvertSysDate()
Dim dwLCID As Long
dwLCID = GetSystemDefaultLCID()
If SetLocaleInfo(dwLCID, LOCALE_SSHORTDATE, "MM/dd/yyyy") = _
False Then
Exit Sub
End If
PostMessage HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0
End Sub
 
 
Post #: 1
 
 Re: Help /w system api call to change regional setting - 5/23/2001 3:21:01 AM   
  eak_guy

 

Posts: 15
Score: 0
Joined: 5/23/2001
From: USA
Status: offline
Haven't used it before, but there is a "SetLocale" function in vbscript. You can also run a script remotely in W2K. What are you trying to do?

(in reply to snoorkle29)
 
 
Post #: 2
 
 Re: Help /w system api call to change regional setting - 5/23/2001 3:21:52 AM   
  eak_guy

 

Posts: 15
Score: 0
Joined: 5/23/2001
From: USA
Status: offline
i'm trying to change the date format to mm-dd-yyyy instead of mm-dd-yy.

(in reply to snoorkle29)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Help /w system api call to change regional setting Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts