找回密码
 加入
搜索
查看: 4679|回复: 3

[AU3基础] [以解決]AutoHotkey變更AutoIT

[复制链接]
发表于 2014-11-23 01:45:27 | 显示全部楼层 |阅读模式
本帖最后由 FMP 于 2014-11-27 20:57 编辑

想請教各位~
以下AutoHotkey語法要改成AutoIT的語法要怎麼改??
IPALL = %IP1_1%%IP1_2%%IP1_3%%IP1_4%%IP2_1%%IP3_1%

If(IPALL = 000000)
{
        Location = \\10.10.10.10\share\AUTO-TOOLS
} else
{
        Location = \\10.10.10.10\share\AUTO-TOOLS
}

Location = \\zxy.local\public\Software\share\MIS_TOOL
LocaName = \\zxy.local\public\Software\share
IcoName = \\zxy.local\public\Software\share\MIS_TOOL\MIS_Tool_ICO

FileCreateDir, %A_ProgramFiles%\MIS_TOOL
FileCreateDir, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO


file1 = Function_dfrg.exe
file2 = Function_eforward_process_kill.exe
file3 = Function_excel_process_kill.exe
file4 = Function_language_change.exe
file5 = Function_powerpoint_process_kill.exe
file6 = Function_clean_garbage.exe
file7 = Function_usb_antivirus.exe
file8 = Kill Notes.EXE
file9 = Function_Wireless_Set.exe
file10 = Function_InternetProxyChange(TOT).exe
file11 = Function_show_my_ip.exe
file12 = Office_ZIP.exe
file13 = MIS_TOOL.exe
file14 = Function_Compute_Information.exe
file15 = clean C.ppt
file16 = ccleaner_zip.exe
file17 = readme.ppt
file18 = Function_Connection_Interface.exe
file19 = pdfcreator.chm
file20 = XnView.chm
file21 = 7zip.chm
file22 = 6_6.ico
file23 = MIS.jpg
file24 = 1_1.ico
file25 = 1_2.ico
file26 = 2_1.ico
file27 = 2_2.ico
file28 = 3_1.ico
file29 = 3_2.ico
file30 = 3_3.ico
file31 = 3_4.ico
file32 = 4_1.ico
file33 = 4_2.ico
file34 = 5_1.ico
file35 = 5_2.ico
file36 = 6_1.ico
file37 = 6_2.ico
file38 = 6_3.ico
file39 = 6_4.ico
file40 = tab_rmvbsafe.ico
file41 = warming.gif
file42 = 6_5.ico
file43 = MIS_1.JPG
file44 = McAfee.ico
file45 = 5_3.ico

FileGetSize, size1, %A_ProgramFiles%\MIS_TOOL\%file1%
FileGetSize, size2, %A_ProgramFiles%\MIS_TOOL\%file2%
FileGetSize, size3, %A_ProgramFiles%\MIS_TOOL\%file3%
FileGetSize, size4, %A_ProgramFiles%\MIS_TOOL\%file4%
FileGetSize, size5, %A_ProgramFiles%\MIS_TOOL\%file5%
FileGetSize, size6, %A_ProgramFiles%\MIS_TOOL\%file6%
FileGetSize, size7, %A_ProgramFiles%\MIS_TOOL\%file7%
FileGetSize, size8, %A_ProgramFiles%\MIS_TOOL\%file8%
FileGetSize, size9, %A_ProgramFiles%\MIS_TOOL\%file9%
FileGetSize, size10, %A_ProgramFiles%\MIS_TOOL\%file10%
FileGetSize, size11, %A_ProgramFiles%\MIS_TOOL\%file11%
FileGetSize, size12, %A_ProgramFiles%\MIS_TOOL\%file12%
FileGetSize, size13, %A_DesktopCommon%\%file13%
FileGetSize, size14, %A_ProgramFiles%\MIS_TOOL\%file14%
FileGetSize, size15, %A_ProgramFiles%\MIS_TOOL\%file15%
FileGetSize, size16, %A_ProgramFiles%\MIS_TOOL\%file16%
FileGetSize, size17, %A_ProgramFiles%\MIS_TOOL\%file17%
FileGetSize, size18, %A_ProgramFiles%\MIS_TOOL\%file18%
FileGetSize, size19, %A_ProgramFiles%\MIS_TOOL\%file19%
FileGetSize, size20, %A_ProgramFiles%\MIS_TOOL\%file20%
FileGetSize, size21, %A_ProgramFiles%\MIS_TOOL\%file21%
FileGetSize, size22, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file22%
FileGetSize, size23, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file23%
FileGetSize, size24, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file24%
FileGetSize, size25, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file25%
FileGetSize, size26, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file26%
FileGetSize, size27, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file27%
FileGetSize, size28, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file28%
FileGetSize, size29, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file29%
FileGetSize, size30, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file30%
FileGetSize, size31, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file31%
FileGetSize, size32, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file32%
FileGetSize, size33, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file33%
FileGetSize, size34, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file34%
FileGetSize, size35, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file35%
FileGetSize, size36, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file36%
FileGetSize, size37, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file37%
FileGetSize, size38, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file38%
FileGetSize, size39, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file39%
FileGetSize, size40, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file40%
FileGetSize, size41, %A_ProgramFiles%\%file41%
FileGetSize, size42, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file42%
FileGetSize, size43, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file43%
FileGetSize, size44, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file44%
FileGetSize, size45, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file45%

FileDelete, %A_ProgramFiles%\MIS_TOOL\tab_rmvbsafe.ico
FileDelete, %A_DesktopCommon%\MIS_TOOL.lnk

if ( size41 != 4474 )
{ 
  Filecopy, %LocaName%\%file41%, %A_ProgramFiles%\%file41%, 1
}


        if ( size1 != 208864 )
        { 
        FileCopy, %Location%\%file1%, %A_ProgramFiles%\MIS_TOOL\%file1%, 1
        }
        if ( size2 != 211013 )
        { 
        FileCopy, %Location%\%file2%, %A_ProgramFiles%\MIS_TOOL\%file2%, 1
        }
        if ( size3 != 211001 )
        {
        FileCopy, %Location%\%file3%, %A_ProgramFiles%\MIS_TOOL\%file3%, 1
        }
        if ( size4 != 267613 )
        { 
        FileCopy, %Location%\%file4%, %A_ProgramFiles%\MIS_TOOL\%file4%, 1
        }
        if ( size5 != 211003 )
        {
        FileCopy, %Location%\%file5%, %A_ProgramFiles%\MIS_TOOL\%file5%, 1
        }
        if ( size6 != 207742 )
        { 
        FileCopy, %Location%\%file6%, %A_ProgramFiles%\MIS_TOOL\%file6%, 1
        }
        if ( size7 != 208936 )
        {
        FileCopy, %Location%\%file7%, %A_ProgramFiles%\MIS_TOOL\%file7%, 1
        }
        if ( size8 != 20480 )
        {
        FileCopy, %Location%\%file8%, %A_ProgramFiles%\MIS_TOOL\%file8%, 1
        }
        if ( size9 != 302273 )
        {
        FileCopy, %Location%\%file9%, %A_ProgramFiles%\MIS_TOOL\%file9%, 1
        }
        
        if ( size11 != 208910)
        {
        FileCopy, %Location%\%file11%, %A_ProgramFiles%\MIS_TOOL\%file11%, 1
        }
        if ( size12 != 514560 )
        {
        FileCopy, %Location%\%file12%, %A_ProgramFiles%\MIS_TOOL\%file12%, 1
        }
        if ( size13 != 290651)
        {
        FileCopy, %Location%\%file13%, %A_DesktopCommon%\%file13%, 1
        }
        if ( size14 != 296081)
        {
        FileCopy, %Location%\%file14%, %A_ProgramFiles%\MIS_TOOL\%file14%, 1
        }
        if ( size15 != 249856)
        {
        FileCopy, %Location%\%file15%, %A_ProgramFiles%\MIS_TOOL\%file15%, 1
        }
        if ( size16 != 683485)
        {
        FileCopy, %Location%\%file16%, %A_ProgramFiles%\%file16%, 1
        }
        if ( size17 != 422912)
        {
        FileCopy, %Location%\%file17%, %A_ProgramFiles%\MIS_TOOL\%file17%, 1
        }
        if ( size18 != 290623)
        {
        FileCopy, %Location%\%file18%, %A_ProgramFiles%\MIS_TOOL\%file18%, 1
        }
        if ( size19 != 1472814)
        {
        FileCopy, %Location%\%file19%, %A_ProgramFiles%\MIS_TOOL\%file19%, 1
        }
        if ( size20 != 1383006)
        {
        FileCopy, %Location%\%file20%, %A_ProgramFiles%\MIS_TOOL\%file20%, 1
        }
        if ( size21 != 1562538)
        {
        FileCopy, %Location%\%file21%, %A_ProgramFiles%\MIS_TOOL\%file21%, 1
        }
        if ( size22 != 67984)
        {
        FileCopy, %IcoName%\%file22%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file22%, 1
        }
        if ( size23 != 32228)
        {
        FileCopy, %IcoName%\%file23%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file23%, 1
        }
        if ( size24 != 3134)
        {
        FileCopy, %IcoName%\%file24%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file24%, 1
        }
        if ( size25 != 3134)
        {
        FileCopy, %IcoName%\%file25%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file25%, 1
        }
        if ( size26 != 3134)
        {
        FileCopy, %IcoName%\%file26%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file26%, 1
        }
        if ( size27 != 3134)
        {
        FileCopy, %IcoName%\%file27%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file27%, 1
        }
        if ( size28 != 3134)
        {
        FileCopy, %IcoName%\%file28%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file28%, 1
        }
        if ( size29 != 4286)
        {
        FileCopy, %IcoName%\%file29%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file29%, 1
        }
        if ( size30 != 4286)
        {
        FileCopy, %IcoName%\%file30%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file30%, 1
        }
        if ( size31 != 3134)
        {
        FileCopy, %IcoName%\%file31%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file31%, 1
        }
        if ( size32 != 766)
        {
        FileCopy, %IcoName%\%file32%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file32%, 1
        }
        if ( size33 != 2238)
        {
        FileCopy, %IcoName%\%file33%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file33%, 1
        }
        if ( size34 != 3638)
        {
        FileCopy, %IcoName%\%file34%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file34%, 1
        }
        if ( size35 != 2562)
        {
        FileCopy, %IcoName%\%file35%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file35%, 1
        }
        if ( size36 != 2238)
        {
        FileCopy, %IcoName%\%file36%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file36%, 1
        }
        if ( size37 != 2238)
        {
        FileCopy, %IcoName%\%file37%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file37%, 1
        }
        if ( size38 != 2238)
        {
        FileCopy, %IcoName%\%file38%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file38%, 1
        }
        if ( size39 != 3134)
        {
        FileCopy, %IcoName%\%file39%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file39%, 1
        }
        if ( size40 != 9662)
        {
        FileCopy, %IcoName%\%file40%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file40%, 1
        }
        if ( size42 != 161862)
        {
        FileCopy, %IcoName%\%file42%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file42%, 1
        }
        if ( size43 != 161862)
        {
        FileCopy, %IcoName%\%file43%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file43%, 1
        }
        if ( size44 != 161862)
        {
        FileCopy, %IcoName%\%file44%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file44%, 1
        }
        if ( size45 != 3262)
        {
        FileCopy, %IcoName%\%file45%, %A_ProgramFiles%\MIS_TOOL\MIS_Tool_ICO\%file45%, 1
        }
return
发表于 2014-11-23 12:41:53 | 显示全部楼层
回复 1# FMP


  自己比对着改吧. 其实很简单的,多数是定义变量,最后一堆是文件大小不符合时进行拷贝操作.
;这之前的代码没什么意义了吧?
Dim $Location = '\\zxy.local\public\Software\share\MIS_TOOL'
Dim $LocaName = '\\zxy.local\public\Software\share'
Dim $IcoName = '\\zxy.local\public\Software\share\MIS_TOOL\MIS_Tool_ICO'

DirCreate(@ProgramFilesDir & '\MIS_TOOL')
DirCreate(@ProgramFilesDir & '\MIS_TOOL\MIS_Tool_ICO')

Dim $file1 = 'Function_dfrg.exe'
Dim $size1 = FileGetSize(@ProgramFilesDir & '\MIS_TOOL\' & $file1)

FileDelete(@ProgramFilesDir & '\MIS_TOOL\tab_rmvbsafe.ico')
FileDelete(@DesktopCommonDir & '\MIS_TOOL.lnk')

if ( $size1 <> 208864 ) Then
        FileCopy($Location & '\' & $file1, @ProgramFilesDir & '\MIS_TOOL\' & $file1, 1)
EndIf
 楼主| 发表于 2014-11-23 18:36:31 | 显示全部楼层
感謝user3000解說~
我會試著改看看~再來回報成功與否!
謝謝
 楼主| 发表于 2014-11-27 20:58:27 | 显示全部楼层
感謝user3000解說~
小弟已修改成功~並能正常執行!!
謝謝
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-12-23 08:17 , Processed in 0.074170 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表