• 2011-09-212011-09-21

    autoit学习成果 - [电脑技术]

    中午那会学习了一下autoit,现在交个作业吧,自己测试了不同分辨率下的效果,完全一致,效果很满意,嘿嘿。

    这个是UsbDiskSecurity的全自动安装版,就是用的官方原版,然后加入注册码,只要双击安装包就全部自动安装完成并启动监控,勾选自动删除u盘中的威胁。附上在dbank的下载链接:  http://dl.dbank.com/c0jjjgrroa

    并附上完整的autoit源码:

    #Region ;**** 参数创建于 ACNWrapper_GUI ****
    #AutoIt3Wrapper_Icon=..\install.ico
    #AutoIt3Wrapper_Outfile=usbdefender.exe
    #EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
    #Region ;**** 参数创建于 AutoIt3Wrapper_GUI ****
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    ;安装软件
    Run("UsbDiskSecurity5.4.0.12.exe")
    WinWait("Setup - USB Disk Security")
    WinWaitActive("Setup - USB Disk Security","Welcome to the USB Disk Security Setup Wizard")
    Send("n")
    WinWaitActive("Setup - USB Disk Security","License Agreement")
    send("!a")
    Send("n")
    WinWaitActive("Setup - USB Disk Security","Setup will install USB Disk Security into the following folder.")
    Send("C:\Program Files\USB Disk Security")
    Send("{enter}")
    WinWaitActive("Setup - USB Disk Security","Setup will create the program's shortcuts in the following Start Menu folder.")
    Send("{enter}")
    WinWaitActive("Setup - USB Disk Security","Select the additional tasks you would like Setup to perform while installing USB Disk Security, then click Next.")
    Send("!d");不选择在桌面创建快捷方式
    Send("n")
    WinWaitActive("Setup - USB Disk Security","Click Install to continue with the installation, or click Back if you want to review or change any settings.")
    Send("i")
    WinWaitActive("Setup - USB Disk Security","Setup has finished installing USB Disk Security on your computer. The application may be launched by selecting the installed icons.")
    Send("f")
    ;安装到此结束,软件会自动最小化并启动u盘监控
    WinWaitActive("USB Disk Security");等待右下角弹出提示窗口
    Run("C:\Program Files\USB Disk Security\USBGuard.exe");启动主界面
    WinWaitActive("USB Disk Security","Information");检测到该文字时表明进入操作界面
    ControlClick("USB Disk Security", "", "[ID:1000]");点击information按钮
    ControlClick("USB Disk Security", "", "[ID:1004]");点击注册按钮
    WinWait("Activate the application", "please enter your license code here.");当检测到弹出窗口标题为激活应用程序时,并且内含请输入序列号的字样时执行后续操作
    Send("laolao");用户名
    Send("{tab}");换行到注册码
    Send("79D8A-1DE0A-F5199-07DC6-11E96-C316E-DC44E-0F9E5");输入注册码
    Send("{tab}{enter}");换行到激活按钮并确定激活
    WinWaitActive("USB Disk Security","USBShield");检测到该文字时表明进入操作界面
    ControlClick("USB Disk Security", "", "[ID:1001]");点击USBShield按钮
    ControlClick("USB Disk Security", "", "[ID:1064]")
    Sleep(2000)
    Send("!{F4}")

     

     

     

    最后一个小总结:安装时一定要注意默认输入法是美式键盘,即英文状态,不然自动输入next快捷键n的时候讨厌的搜狗就会跳出来出现一个n,真喪眼啊。。。。

    分享到: