Local $language_selection = "Chinese (PRC)" _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") FileChangeDir("D:") Run("D:\fscommand\Setup.exe") WinWait("欢迎") ControlClick("欢迎", "", "Button1") WinWait("软件许可证协议") ControlClick("软件许可证协议", "", "Button2") WinWait("选择目标位置") ControlClick("选择目标位置", "", "Button1") WinWait("选择程序文件夹") ControlClick("选择程序文件夹", "", "Button2") WinWait("安装完毕") ControlCommand("安装完毕", "", "Button1", "Check") ControlClick("安装完毕", "", "Button4") 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