RunWait(@ComSpec & ' /c bcdedit /create /d "安装一键还原精灵装机版" /application bootsector >c:\windows\vidadd.ini', "", @SW_HIDE)
$text = FileRead("c:\windows\vidadd.ini")
$yjhytil = StringReplace($text, @CRLF, "")
$yjhytil1 = StringReplace($yjhytil, "项", "")
$yjhytil2 = StringReplace($yjhytil1, "成功创建。", "")
RunWait(@ComSpec & " /c bcdedit /set " & $yjhytil2 & " device partition=c:", "", @SW_HIDE)
RunWait(@ComSpec & " /c bcdedit /set " & $yjhytil2 & " path \gvldr.mbr", "", @SW_HIDE)
RunWait(@ComSpec & " /c bcdedit /displayorder " & $yjhytil2 & " /addlast", "", @SW_HIDE)
RunWait(@ComSpec & " /c bcdedit /default " & $yjhytil2, "", @SW_HIDE)
RunWait(@ComSpec & " /c bcdedit /timeout 8", "", @SW_HIDE)
FileDelete("c:\windows\vidadd.ini")
希望高手给予指点 让代码更灵活 最好不产生临时文件! |