Local $language_selection = "Japanese" _Languages() If not (ControlCommand("Regional and Language Options", "Advanced", "ComboBox1", "GetCurrentSelection") == $language_selection) Then _prereboot() Else _postreboot() EndIf Func _Languages() ShellExecute("Control.exe", "C:\WINDOWS\system32\intl.cpl") WinWait("Regional and Language Options", "Regional Options") ControlCommand("Regional and Language Options", "Regional Options", "SysTabControl321", "TabRight") WinWait("Regional and Language Options", "Languages") ControlCommand("Regional and Language Options", "Languages", "SysTabControl321", "TabRight") WinWait("Regional and Language Options", "Advanced") EndFunc func _prereboot() ControlCommand("Regional and Language Options", "Advanced", "ComboBox1", "SelectString", $language_selection) ControlClick("Regional and Language Options", "Advanced", "Button7") WinWait("Advanced", "skip file copying and use the existing files") ControlClick("Advanced", "skip file copying and use the existing files", "Button1") WinWait("Change Regional Options", "Do you want to restart your computer now?", 3) ControlClick("Change Regional Options", "Do you want to restart your computer now?", "Button2") ControlClick("Regional and Language Options", "Advanced", "Button5") _RunOnce() Shutdown(2) EndFunc Func _postreboot() WinClose("Regional and Language Options") ShellExecute("C:\Program Files\Internet Explorer\iexplore.exe", "D:\INDEX_HTML\INDEX.HTML", "D:\INDEX_HTML\") ShellExecute("C:\Program Files\Internet Explorer\iexplore.exe", "E:\INDEX_HTML\INDEX.HTML", "E:\INDEX_HTML\") Sleep(3000) If WinExists("Internet Explorer", "Active content") Then Sleep(1000) ControlClick("[LAST]", "", "Button3") EndIf EndFunc Func _RunOnce() Local $key = 'HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce' If @Compiled Then RegWrite($key, '_MAPS', 'Reg_sz', '"' & @ScriptFullPath & '" /postrun') Else RegWrite($key, '_MAPS', 'Reg_sz', '"' & @AutoItExe & '" "' & @ScriptFullPath & '" /postrun') EndIf EndFunc