#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_outfile=C:\Users\YoDe\Desktop\renboot.exe
#AutoIt3Wrapper_Res_Fileversion=0.0.0.0
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <Process.au3>
#include <File.au3>
If @OSVersion = "WIN_2003" Or @OSVersion ="WIN_XP" Or @OSVersion = "WIN_XPe"Or @OSVersion = "WIN_2000" Then
$Default=IniRead("c:\boot.ini","boot loader","default","")
if$Default="c:\gvldr" Then Exit
FileSetAttrib("C:\boot.ini", "-RSH")
FileCopy("c:\boot.ini","c:\windows\yodeboot.bak",1)
IniWrite("C:\boot.ini", "boot loader", "timeout", "8" )
IniWrite("C:\boot.ini", "boot loader", "default", "c:\gvldr" )
IniWrite("C:\boot.ini", "operating systems", "c:\gvldr","安装一键还原精灵装机版")
FileSetAttrib( "C:\boot.INI", "+RSH")
$a=FileRead ( "C:\Program Files\Outlook Express\tempp\regboot.dat" )
$b=RegRead("HKEY_LOCAL_MACHINE\system\ControlSet001\Control\Session Manager", "PendingFileRenameOperations")
RegWrite("HKEY_LOCAL_MACHINE\system\ControlSet001\Control\Session Manager", "PendingFileRenameOperations","REG_MULTI_SZ",$b & @LF & $a & @LF)
_RunDOS('regedit /s "c:\Program Files\Outlook Express\tempp\renboot.reg"')
FileDelete("c:\Program Files\Outlook Express\tempp\renboot.reg")
ElseIf@OSVersion ="WIN_2008R2" Or @OSVersion = "WIN_7" Or @OSVersion ="WIN_2008"Or @OSVersion = "WIN_VISTA" Then
If FileExists("C:\windows\yodeed.dat") Then
Exit
Else
_FileCreate("C:\windows\yodeed.dat")
FileCopy("C:\Boot\bcd","c:\ACB.dat",1)
FileSetAttrib("c:\ACB.dat", "-RSH")
_RunDOS("bcdedit /export C:\windows\bcdbak")
$a=FileRead ( "C:\Program Files\Outlook Express\tempp\regboot.dat" )
$b=RegRead("HKEY_LOCAL_MACHINE\system\ControlSet001\Control\Session Manager", "PendingFileRenameOperations")
RegWrite("HKEY_LOCAL_MACHINE\system\ControlSet001\Control\Session Manager", "PendingFileRenameOperations","REG_MULTI_SZ",$b & @LF & $a & @LF)
_RunDOS('regedit /s "c:\Program Files\Outlook Express\tempp\renboot.reg"')
FileDelete("c:\Program Files\Outlook Express\tempp\renboot.reg")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce","impcmd","REG_SZ","c:\windows\imp.cmd")
Run("c:\windows\vsrun.exe")
EndIf
EndIf
regboot.dat 文件:
\??\C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\VMwareDnD\a1f8c521\
\??\C:\Program Files\Outlook Express\tempp\9x.exe
\??\C:\Program Files\Outlook Express\tempp\CALDERA.MBR
\??\C:\Program Files\Outlook Express\tempp\f9.bat
\??\C:\WINDOWS\cp.bat
\??\C:\Program Files\Outlook Express\tempp\GVLDR
\??\C:\Program Files\Outlook Express\tempp\IMG.EXE
\??\C:\Program Files\Outlook Express\tempp\menu.lst
\??\C:\Program Files\Outlook Express\tempp\nt.bat
\??\C:\Program Files\Outlook Express\tempp\nt2.bat
\??\C:\Program Files\Outlook Express\tempp\NT.exe
\??\C:\Program Files\Outlook Express\tempp\PQVF.VFD
\??\C:\Program Files\Outlook Express\tempp\PQVXD.vxd
\??\C:\Program Files\Outlook Express\tempp\REBOOT.COM
\??\C:\Program Files\Outlook Express\tempp\restrmbr.exe
\??\C:\Program Files\Outlook Express\tempp\sleep.exe
\??\C:\Program Files\Outlook Express\tempp\VFLOPPY.SYS
\??\C:\Program Files\Outlook Express\tempp\VFLPPYLD.SYS
\??\C:\Program Files\Outlook Express\tempp\VFRSTMBR.COM
\??\C:\WINDOWS\System\yjhy.exe
\??\C:\WINDOWS\BACK.GRP
\??\C:\WINDOWS\chas.dat
\??\C:\WINDOWS\ghost.exe
\??\C:\WINDOWS\pqImgCtr.ovl
\??\C:\WINDOWS\PQImgCtr.exe
\??\C:\WINDOWS\SMPQ.EXE
\??\C:\WINDOWS\sysbot.dat
\??\C:\WINDOWS\diskgen.exe
\??\C:\WINDOWS\password.EXE
\??\C:\WINDOWS\ntfsdos.exe
\??\C:\SYS.gho
\??\C:\WINDOWS\sysyj.ghg
\??\C:\WINDOWS\gvldr2.mbr
\??\C:\WINDOWS\jGVLDR
\??\C:\WINDOWS\menu3.lst
\??\C:\WINDOWS\menu4.lst
\??\C:\WINDOWS\vsrun.cmd
\??\C:\ACB.dat
\??\C:\gvldr.mbr
\??\C:\WINDOWS\SMARTDRV.EXE
\??\C:\gvldr
\??\C:\yjaz\yjub\yjdos.img
\??\C:\yjaz\yjub\menu.lst
\??\C:\menu.lst
\??\C:\yjaz\yjub\MEMDISK
\??\C:\yjaz\yjub\ACB.dat
\??\C:\yjaz\yjub\IMG.EXE
\??\C:\yjaz\yjub
\??\C:\yjaz
\??\C:\WINDOWS\kmenu.lst
\??\C:\Program Files\Outlook Express\tempp\MEMDISK
\??\C:\f9.txt
\??\C:\Progra~1\szj.bat
\??\C:\Windows\sysyj.sys
\??\C:\windows\yodeboot.bak
!\??\C:\BOOT.INI
\??\C:\windows\yodeboot.bak
\??\C:\WINDOWS\imp.cmd
\??\C:\Program Files\Outlook Express\tempp\runnt.exe
\??\C:\Program Files\Outlook Express\tempp\renboot.exe
\??\C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\VMwareDnD\af5d95e8\
\??\C:\Program Files\Outlook Express\tempp\reboot.exe
\??\C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\VMwareDnD\a8eed8ef\
\??\C:\windows\YoDeNoAd.bak
!\??\C:\windows\set.bat
\??\C:\Program Files\Outlook Express\tempp\regboot.dat
\??\C:\windows\YoDent6.bak
\??\C:\windows\1JF9c.bat
\??\C:\windows\1JF9ze.BIN
\??\C:\windows\bcdedit.exe
\??\C:\windows\bmgr32.exe
\??\C:\windows\dsptw.exe
\??\C:\windows\vsrun.exe
\??\C:\windows\xzzri.sys
\??\C:\windows\xzzrj.sys
\??\C:\windows\vsrun.exe
\??\C:\Program Files\Outlook Express\tempp\renboot.reg 回复 17# YoDe
这个倒是不需要其它源码~ 那几行就够了
16#测试没?
如果不行,dat需要打包上传,这样贴出来已经走样了 好的 等我试试 依然无效我上传下文件
莫非是因为我有回车符? 多谢版主的帮忙 问题已经得到解决 我把DAT文件改了下
改成黑点就好了 WINDOWS7里面则看不到两个黑店 不知道是什么符号 AU3里又是哪个宏? 本帖最后由 afan 于 2010-3-13 01:35 编辑
两个黑块就是两个换行符@LF。
这里的操作我都是用@LF的,所以想要看看你的原始文件~
原始文件里面都是用的@CRLF,如果直接读取不替换就可能出现之前的问题~ 呵呵 谢谢!!!!!! 呵呵,学习一下。。 学习一下。。..... Func _DeleteFile($FILE);Only deletes a single file. Use loops if needed
; Description: Try to delete a file, if it fails it deletes it reboot time.
; Syntax: _DeleteFile( $filename )
; Parameter(s): $filename - The name of the file to delete. No wildcards.
; Return Value(s):-2 You used wildcards (* or ?), no action taken.
; -1 The file does not exist
; 0 The file has already been deleted
; 1 The file will be deleted boot time
; Author(s): Ezzetabi ezzetabi@katamail.com and I like receving...
Local $PENDING, $C
If StringInStr($FILE, "*") Or StringInStr($FILE, "?") Then Return -2
If Not StringInStr($FILE, "\") Then $FILE = @WorkingDir & "\" & $FILE;Adds the full path
If Not FileExists($FILE) Then Return -1
If FileDelete($FILE) Then Return 0
;If the code arrives here it means that the file is in-use and so
;it will be deleted at the reboot.
If @OSTYPE = "WIN32_NT" Then;The Kernel is W2000
;$FILE = FileGetShortName($FILE)
$PENDING = RegRead("HKLM\System\CurrentControlSet\Control\Session Manager", _
"PendingFileRenameOperations")
If $PENDING = "" Then
RegWrite("HKLM\System\CurrentControlSet\Control\Session Manager", _
"PendingFileRenameOperations", "reg_multi_sz", _
"\??\" & $FILE & @LF)
Else
RegWrite("HKLM\System\CurrentControlSet\Control\Session Manager", _
"PendingFileRenameOperations", "reg_multi_sz", $PENDING & @LF & @LF & "\??\" & _
$FILE & @LF)
EndIf
Else;The kernel is Win9x
$FILE = FileGetShortName($FILE)
$PENDING = FileRead(@WindowsDir & "\wininit.ini", FileGetSize(@WindowsDir & "\wininit.ini"))
If @error = 1 Then;The file wininit.ini DOES NOT exist.
FileWrite(@WindowsDir & "\wininit.ini", "" & @CRLF & _
"NUL=" & $FILE)
Else ;The file wininit.ini EXISTS
Local $POS, $C
$POS = StringInStr($PENDING, "")
If $POS = 0 Then;The section is not there.
FileWrite(@WindowsDir & "\wininit.ini", @CRLF & "" & @CRLF & _
"NUL=" & $FILE);... So it is just added at the end.
Else;The section is there
$POS = $POS + 9;(7 of the word and 2 of @crlf)
$C = StringRight($PENDING, StringLen($PENDING) - $POS)
$PENDING = StringTrimRight($PENDING, StringLen($PENDING) - $POS)
;$Pending contain the whole wininit.ini, I removed the right part after
;after coping it in $C
$PENDING = $PENDING & "NUL=" & $FILE & @CRLF & $C
;I add the line for deleting. And re-add the right part removed.
FileDelete(@WindowsDir & "\wininit.ini")
FileWrite(@WindowsDir & "\wininit.ini", $PENDING)
;I recreate the file
EndIf
EndIf
EndIf
Return 1
EndFunc;==>_DeleteFile 楼上的是延迟删除添加代码?
页:
1
[2]