Autohotkey語法變更
本帖最后由 FMP 于 2014-12-3 14:34 编辑小弟還有一個Autohotkey語法需改成AutoIT語法
請各位指導小弟要怎麼修改
謝謝~If ( A_OSVersion = "WIN_XP" or A_OSVersion = "WIN_VISTA" ) {
If (UserDomain = "AAA")
{
VMOK := InStr(A_ComputerName,"VM",false,1)
If (VMOK = 1)
{
Gosub, PreinstallAAA
}
NBOK := InStr(A_ComputerName,"NB",false,1)
If (NBOK = 1)
{
Gosub, PreinstallAAA
}
PCOK := InStr(A_ComputerName,"PC",false,1)
If (PCOK = 1)
{
Gosub, PreinstallAAA
}
} else {
Gosub, PreinstallnotAAA
}
} else {
return
}
return
PreinstallAAA:
Location = \\100.10.1.10\public\Software\share
file1 = Preinstall.gif
FileGetSize, size1, %A_ProgramFiles%\%file1%
if ( size1 != 4075 )
{
Filecopy, %Location%\%file1%, C:\Program Files, 1
Sleep, 100
}
Subject = Preinstallation check --by AAAMIS
SetTitleMatchMode, 2
SetTitleMatchMode, fast
SplashImage, C:\Program Files\%file1% ,b2 fmn18 fs12, ,%Subject% ,Wintitle999
WinMove, Wintitle999, , 0, 0
RunAs, abc, 1qaz2wsx, AAA
Runwait, at /delete /yes,,hide
Runwait, at 12:05 /interactive /every:Monday`,Tuesday`,Wednesday`,Thursday`,Friday "%Location%\Function_copy_desktop_tool.exe",,hide
Runwait, at 12:22 /interactive /every:Wednesday "%Location%\Function_Wed_5S_Notice.exe",,hide
Runwait, at 12:45 /interactive /every:Monday`,Tuesday`,Wednesday`,Thursday`,Friday "C:\Program Files\ccleaner_zip.exe",,hide
Runwait, at 11:59 /interactive /every:Monday`,Tuesday`,Wednesday`,Thursday`,Friday "%Location%\Install_McAfee_ENG.exe",,hide
Runwait, %comspec% /c "net localgroup "Administrators" /delete TOT\%username%", ,hide
Runwait, %comspec% /c "net localgroup "Power Users" /add "TOT\Domain Users"", ,hide
Runwait, %comspec% /c "net localgroup "Administrators" /add "TOT\MIS-FIX"", ,hide
Runwait, %comspec% /c "net localgroup "Administrators" /add "TOT\TECH-Maintain"", ,hide
SplashImage, OFF
RunAs
Run, %comspec% /c "gpupdate /force", ,hide
Run, %comspec% /c "wuauclt /detectnow", ,hide
Runwait, %Location%\AUTO-TOOLS\Install_McAfee.exe
RegRead, OutputVar, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{23170F69-40C1-2701-0465-000001000000}, DisplayName
if(OutputVar = "7-Zip 4.65")
{
;do nothing
} else {
Runwait, %Location%\AUTO-TOOLS\Install_7-zip.exe
}
Runwait, %Location%\AUTO-TOOLS\Install_Adobe_Reader_9_update.exe
Runwait, %Location%\AUTO-TOOLS\Install_adobe_flash_player.exe
return
PreinstallnotAAA:
Location = \\100.10.1.10\public\Software\share
Runwait, at /delete /yes,,hide
Runwait, at 12:05 /interactive /every:Monday`,Tuesday`,Wednesday`,Thursday`,Friday "%Location%\Function_copy_desktop_tool.exe",,hide
return
懇請各位幫幫忙了!! 小弟有嘗試改了一些
請各位幫我看看哪裡改的對不對#include <GUIConstantsEx.au3>
@OSVersion = "WIN_XP" Or@OSVersion = "WIN_7"
@LogonDomain= "AAA"
{
;判別VM
VMOK := InStr(A_ComputerName,"VM",false,1)
If (VMOK = 1)
{
Gosub, PreinstallAAA
}
;判別NB
NBOK := InStr(A_ComputerName,"NB",false,1)
If (NBOK = 1)
{
Gosub, PreinstallAAA
}
;判別PC
PCOK := InStr(A_ComputerName,"PC",false,1)
If (PCOK = 1)
{
Gosub, PreinstallAAA
}
} else {
Gosub, PreinstallnotAAA
}
} else {
return
}
return
PreinstallAAA:
$Location = "\\100.10.1.10\public\Software\share"
$file1 = "Preinstall.gif"
$size1 = FileGetSize(@ProgramFilesDir &$file1)
if ( $size1 <> 4075 ) Then FileCopy($Location & '\' & $file1, @ProgramFilesDir &$file1, 1)
Sleep, (100)
$Label1 = GuiCtrlCreateLabel ("Preinstallation check --by (AAA)MIS")
SetTitleMatchMode, 2
SetTitleMatchMode, fast
SplashImage, C:\Program Files\%file1% ,b2 fmn18 fs12, ,%Subject% ,Wintitle999
WinMove, Wintitle999, , 0, 0
RunAs, autorun, qwertyuiop[], AAA
Runwait, at /delete /yes,,hide
Runwait, at 12:05 /interactive /every:Monday`,Tuesday`,Wednesday`,Thursday`,Friday "%Location%\Function_copy_desktop_tool.exe",,hide
Runwait, at 12:22 /interactive /every:Wednesday "%Location%\Function_Wed_5S_Notice.exe",,hide
Runwait, at 12:45 /interactive /every:Monday`,Tuesday`,Wednesday`,Thursday`,Friday "C:\Program Files\ccleaner_zip.exe",,hide
Runwait, at 11:59 /interactive /every:Monday`,Tuesday`,Wednesday`,Thursday`,Friday "%Location%\Install_McAfee.exe",,hide
Runwait, %comspec% /c "net localgroup "Administrators" /delete TOT\%username%", ,hide
Runwait, %comspec% /c "net localgroup "Power Users" /add "TOT\Domain Users"", ,hide
Runwait, %comspec% /c "net localgroup "Administrators" /add "TOT\MIS-FIX"", ,hide
Runwait, %comspec% /c "net localgroup "Administrators" /add "TOT\TECH-Maintain"", ,hide
SplashImage, OFF
RunAs
Run, %comspec% /c "gpupdate /force", ,hide
Run, %comspec% /c "wuauclt /detectnow", ,hide
Runwait( $Location & "\AUTO-TOOLS\Install_McAfee.exe")
$DisplayName=RegRead(" HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{23170F69-40C1-2701-0465-000001000000}"," DisplayName")
if $DisplayName > = "7-Zip 4.65")
else
Runwait( $Location & "\AUTO-TOOLS\Install_7-zip.exe")
Runwait( $Location & "\AUTO-TOOLS\Install_Adobe_Reader_9_update.exe")
Runwait( $Location & "\AUTO-TOOLS\Install_adobe_flash_player.exe")
return
PreinstallnotAAA:
$Location = "\\100.10.1.10\public\Software\share"
Runwait, at /delete /yes,,hide
Runwait, at 12:05 /interactive /every:Monday`,Tuesday`,Wednesday`,Thursday`,Friday "%Location%\Function_copy_desktop_tool.exe",,hide
return
页:
[1]