dkwokgs Posted August 16, 2010 Share Posted August 16, 2010 Hi There, I have tried using the registry method but it does not refresh the system immediately. I need to change the date format for about 2000 computers. Found this "setLocaleInfo" on Microsoft website but do not know how to use it in Autoit. Please advise. http://msdn.microsoft.com/en-us/library/aa913806.aspx Thanks in advanced. Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 16, 2010 Share Posted August 16, 2010 Your link is to the wrong version (WinCE). The correct one is on MSDN: SetLocaleInfo Function.Yashied's WinAPIEx UDF has a _WinAPI_GetLocaleInfo(), but not the coresponding _WinAPI_SetLocaleInfo(). You'll have to roll your own. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Yashied Posted August 17, 2010 Share Posted August 17, 2010 expandcollapse popup#Include <WinAPIEx.au3> Global Const $LOCALE_INVARIANT = 0x007F Global Const $LOCALE_SYSTEM_DEFAULT = 0x0800 Global Const $LOCALE_USER_DEFAULT = 0x0400 Global Const $LOCALE_CUSTOM_DEFAULT = 0x0C00 Global Const $LOCALE_CUSTOM_UI_DEFAULT = 0x1400 Global Const $LOCALE_CUSTOM_UNSPECIFIED = 0x1000 _WinAPI_SetLocaleInfo($LOCALE_USER_DEFAULT, $LOCALE_SSHORTDATE, 'dd-MMM-yy') ; #FUNCTION# ==================================================================================================================== ; Name...........: _WinAPI_SetLocaleInfo ; Description....: Sets an item of information in the user override portion of the current locale. ; Syntax.........: _WinAPI_SetLocaleInfo ( $LCID, $iType, $sData ) ; Parameters.....: $LCID - Locale identifier for which to set information. ; $iType - Type of locale information to set. This parameter can be one of the $LOCALE_... constants. ; $sData - The string containing the locale information to set. The information must be in the format specific to ; the specified constant. ; Return values..: Success - 1. ; Failure - 0 and sets the @error flag to non-zero. ; Author.........: Yashied ; Modified.......: ; Remarks........: None ; Related........: ; Link...........: @@MsdnLink@@ SetLocaleInfo ; Example........: Yes ; =============================================================================================================================== Func _WinAPI_SetLocaleInfo($LCID, $iType, $sData) Local $Ret = DllCall('kernel32.dll', 'int', 'SetLocaleInfoW', 'long', $LCID, 'int', $iType, 'wstr', $sData) If (@error) Or (Not $Ret[0]) Then Return SetError(1, 0, 0) EndIf Return 1 EndFunc ;==>_WinAPI_SetLocaleInfo My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 17, 2010 Share Posted August 17, 2010 I was going to send Yashied a PM, but as they say "Speak of the devil..." Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now