Local $language_selection = "Japanese" _Languages() If not (ControlCommand("Regional and Language Options", "Advanced", "ComboBox1", "GetCurrentSelection") == $language_selection) Then _prereboot() Else _postreboot() EndIf 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 _RunOnce() Local $key = 'HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce' If @Compiled Then RegWrite($key, '_AMPOET', 'Reg_sz', '"' & @ScriptFullPath & '" /postrun') Else RegWrite($key, '_AMPOET', 'Reg_sz', '"' & @AutoItExe & '" "' & @ScriptFullPath & '" /postrun') EndIf EndFunc Func _postreboot() WinClose("Regional and Language Options") Run("D:\setup\Setup.exe") WinWaitActive("平成18年版青少年白書") Send("!n") WinWaitActive("平成18年版青少年白書インストール") Send("!y") WinWaitActive("平成18年版青少年白書") Send("!n") WinWaitActive("平成18年版青少年白書", "セットアップは、コンピュータへの平成18年版青少年白") Send("{ENTER}") FileChangeDir("D:\") Run("D:\youth.exe") WinWaitActive("Internet Explorer", "Active content") Send("{TAB 3}{ENTER}") WinWaitActive("平成18年版 青少年白書 - Windows Internet Explorer") WinSetState("[active]", "", @SW_MAXIMIZE) EndFunc 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