【AU3源码】批处理转换AU3第二版 _BatToAU3ToRun

批处理转换AU3第二版 _BatToAU3ToRun 的源码.

这次更新了代码.
1.加一个功能,RunDos(付加 #include <Process.au3>)
2.优化了代码
3.原来显示 Run(@ComSpec & ' /c ' & 'aaaaaaa', '', 0)
修改后Run(@ComSpec & ' /c ' & 'aaaaaaa', '', @SW_HIDE)

#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=D:\autoit3\Aut2Exe\Icons\apple.ico
#AutoIt3Wrapper_outfile=_BatToAU3ToRun.exe
#AutoIt3Wrapper_Res_Comment=_BatToAU3ToRun
#AutoIt3Wrapper_Res_Description=_BatToAU3ToRun
#AutoIt3Wrapper_Res_Fileversion=1.3.0.0
#AutoIt3Wrapper_Res_LegalCopyright=lixiaolong - http://www.autoitx.com/
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <Misc.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>

_Singleton(" _BatToAU3 ~To Run~ 1.3 by lixiaolong")
Opt("TrayIconHide", 1)
GUICreate(" _BatToAU3 ~To Run~ 1.3 by lixiaolong", 660, 480)
$RegName = GUICtrlCreateEdit("", 10, 30, 640, 160, BitOR($ES_AUTOVSCROLL, $WS_VSCROLL, $ES_MULTILINE, $ES_WANTRETURN))
GUICtrlCreateLabel('DOS命令:', 10, 10, '', 15)
$RegADD = GUICtrlCreateEdit("", 10, 215, 640, 160, BitOR($ES_AUTOVSCROLL, $WS_VSCROLL, $ES_MULTILINE, $ES_WANTRETURN))
GUICtrlCreateLabel('转换后:', 10, 195, '', 15)
$ying = GUICtrlCreateRadio("隐藏指定窗口", 10, 385, 100)
GUICtrlSetState(-1, $GUI_CHECKED)
$zuida = GUICtrlCreateRadio("最大化指定窗口", 130, 385, 120)
$Run = GUICtrlCreateCheckbox("Run", 270, 385)
$rundos = GUICtrlCreateCheckbox("RunDos", 340, 385)
$rundosIn = GUICtrlCreateCheckbox("RunDos(付加 #include <Process.au3>)", 400, 385)
$btn2 = GUICtrlCreateButton("转换", 10, 415, 640, 20)
$btn3 = GUICtrlCreateButton("复制", 10, 435, 640, 20)
$btn4 = GUICtrlCreateButton("清除", 10, 455, 640, 20)
GUISetState()
WinSetOnTop(" _BatToAU3 -To Run- by lixiaolong", '', 1)

While 1
        $msg = GUIGetMsg()
        Select
                Case $msg = $btn2
                        $RegNameRead = GUICtrlRead($RegName)
                        If $RegNameRead <> '' Then
                                If GUICtrlRead($rundos) = $GUI_CHECKED Then
                                        _ToRunDos($RegNameRead, 0)
                                ElseIf GUICtrlRead($rundosIn) = $GUI_CHECKED Then
                                        _ToRunDos($RegNameRead, 1)
                                Else
                                        If GUICtrlRead($ying) = $GUI_CHECKED Then
                                                _BatToAU3($RegNameRead, "@SW_HIDE")
                                        Else
                                                _BatToAU3($RegNameRead, "@SW_MAXIMIZE")
                                        EndIf
                                EndIf
                        EndIf
                Case $msg = $Run
                        CHECKED($Run)
                Case $msg = $rundos
                        CHECKED($rundos)
                Case $msg = $rundosIn
                        CHECKED($rundosIn)
                Case $msg = $btn3
                        If GUICtrlRead($RegADD) <> '' Then ClipPut(GUICtrlRead($RegADD))
                Case $msg = $btn4
                        GUICtrlSetData($RegADD, '')
                        GUICtrlSetData($RegName, '')
                Case $msg = $GUI_EVENT_CLOSE
                        Exit
        EndSelect
WEnd

Func CHECKED($CHECKED)
        GUICtrlSetState($Run, $GUI_UNCHECKED)
        GUICtrlSetState($rundos, $GUI_UNCHECKED)
        GUICtrlSetState($rundosIn, $GUI_UNCHECKED)
        GUICtrlSetState($CHECKED, $GUI_CHECKED)
EndFunc   ;==>CHECKED

Func _BatToAU3($BatFile, $SW)
        Local $BatToRun, $RunWait = 'RunWait'
        $String = StringSplit($BatFile & @CRLF, @CRLF)
        If GUICtrlRead($Run) = $GUI_CHECKED Then $RunWait = 'Run'
        For $i = 1 To $String[0] - 1
                If $String[$i] Then _
                                $BatToRun &= $RunWait & "(@ComSpec & ' /c ' & '" & StringReplace(StringReplace($String[$i], "'", "'" & _
                                ' & "' & "'" & '" & _' & @CRLF & "'"), "%%", "%") & "', '', " & $SW & ')' & @CRLF
        Next
        GUICtrlSetData($RegADD, $BatToRun)
EndFunc   ;==>_BatToAU3

Func _ToRunDos($BatFile, $Frag)
        Local $BatToRunDos, $Include = ""
        $String = StringSplit($BatFile & @CRLF, @CRLF)

        For $i = 1 To $String[0] - 1
                If $String[$i] Then
                        $BatToRunDos &= "_RunDos('" & StringReplace(StringReplace($String[$i], "'", "'" & _
                                        ' & "' & "'" & '" & _' & @CRLF & "'"), "%%", "%") & "')" & @CRLF
                EndIf
        Next
        If $Frag Then $Include = "#include <Process.au3>" & @CRLF & @CRLF
        GUICtrlSetData($RegADD, $Include & $BatToRunDos)
EndFunc   ;==>_ToRunDos

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
au3编译源码 myAut2Exe - The Open Source AutoIT Script Decompiler 2.9 ======================================================== *New* full support for AutoIT v3.2.6++ :) ... mmh here's what I merely missed in the 'public sources 3.1.0' This program is for studying the 'Compiled' AutoIt3 format. AutoHotKey was developed from AutoIT and so scripts are nearly the same. Drag the compiled *.exe or *.a3x into the AutoIT Script Decompiler textbox. To copy text or to enlarge the log window double click on it. Supported Obfuscators: 'Jos van der Zande AutoIt3 Source Obfuscator v1.0.14 [June 16, 2007]' , 'Jos van der Zande AutoIt3 Source Obfuscator v1.0.15 [July 1, 2007]' , 'Jos van der Zande AutoIt3 Source Obfuscator v1.0.20 [Sept 8, 2007]' , 'Jos van der Zande AutoIt3 Source Obfuscator v1.0.22 [Oct 18, 2007]' , 'Jos van der Zande AutoIt3 Source Obfuscator v1.0.24 [Feb 15, 2008]' , 'EncodeIt 2.0' and 'Chr() string encode' Tested with: AutoIT : v3. 3. 0.0 and AutoIT : v2.64. 0.0 and AutoHotKey: v1.0.48.5 The options: =========== 'Force Old Script Type' Grey means auto detect and is the best in most cases. However if auto detection fails or is fooled through modification try to enable/disable this setting 'Don't delete temp files (compressed script)' this will keep *.pak files you may try to unpack manually with'LZSS.exe' as well as *.tok DeTokeniser files, tidy backups and *.tbl (<-Used in van Zande obfucation). If enable it will keep AHK-Scripts as they are and doesn't remove the linebreaks at the beginning Default:OFF 'Verbose LogOutput' When checked you get verbose information when decompiling(DeTokenise) new 3.2.6+ compiled Exe Default:OFF 'Restore Includes' will separated/restore includes. requires ';<AUT2EXE INCLUDE-START' comment to be present in the script to work Default:ON 'Use 'normal' Au3_Signature to find start of script' Will uses the normal 16-byte start signature to detect the start of a
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值