[0]. 오토핫키 ; bcdedit.exe 명령어 정답은?
1. Runwait, %comspec% /c bcdedit /bootsequence %GDD%, , hide
2. Runwait, %comspec% /c bcdedit /bootsequence "%GDD%", , hide
3. Runwait, %comspec% /c "bcdedit /bootsequence ""%GDD%""", , hide
[1]. _.bat ; {ramdiskoptions} -> 없으면 C:\boot.sdi(숨김필요)
bcdedit /create {ramdiskoptions}
bcdedit /set {ramdiskoptions} ramdisksdidevice partition=C:
bcdedit /set {ramdiskoptions} ramdisksdipath "\boot.sdi"
xcopy /hry %windir%\system32\boot.sdi "C:\"
[2]. Legacy/Uefi Mode?
Runwait, %comspec% /c "bcdedit /enum {bootmgr}| find /i "".efi""", , hide
If (ErrorLevel = 1){
UorB=Legacy Bios
}
else{
UorB=Uefi Mode
}
msgbox, %UorB%
[3]. 텍스트(_.bat)의 첫 줄 교체
첫 줄 set b="_.bat"&set wim=%1&set pdrv=%~d1 을
--> set b="_.bat"&set wim=%PeDir%\DISM_Backup\DismRestore.wim&set pdrv=%PeDir%로 교체
fileread, text_list, %PeDir%\DISM_Backup\_.bat
RegExMatch(text_list, ".+?\v", oVar)
text_list := RegExReplace(text_list, ".+?\v", "", "", 1)
Sleep, 300
filedelete, %PeDir%\DISM_Backup\_.bat
fileappend,
(
set b="_.bat"&set wim=%PeDir%\DISM_Backup\DismRestore.wim&set pdrv=%PeDir%
), %PeDir%\DISM_Backup\_.bat
fileappend, %text_list%, %PeDir%\DISM_Backup\_.bat
[4]. 도스창 안 뜨게, 도스 커멘드 실행 후 변수 저장
--------------------
DetectHiddenWindows On
Run %ComSpec%,, Hide, pid
WinWait ahk_pid %pid%
DllCall("AttachConsole", "UInt", pid)
shell := ComObjCreate("WScript.Shell")
cmd := shell.Exec("cmd.exe /q /c diskpart")
cmd.StdIn.WriteLine("list disk`nexit")
result := isGpt(cmd.StdOut.ReadAll())
DllCall("FreeConsole")
Process Close, %pid%
FileAppend,%result%, %A_Temp%\result.txt
--------------------
FileRead, OOD, %pedrv%\DISM_Backup\guid.txt
command0 = %comspec% /c bcdedit /enum %OOD%
DetectHiddenWindows On
Run %ComSpec%,, Hide, pid
WinWait ahk_pid %pid%
DllCall("AttachConsole", "UInt", pid)
WshShell := ComObjCreate("Wscript.Shell")
exec := WshShell.Exec(command0)
output0 := exec.StdOut.ReadAll()
DllCall("FreeConsole")
Process Close, %pid%
msgbox,%output0%
--------------------
[5]. 드랍다운리스트 만들기(height = 999)
choices := ""
loop
{
FileReadLine, line, %A_Temp%\result.txt, %A_Index%
if ErrorLevel
Break
choices = %choices%%line%|
}
Gui, Add, ddl, x168 y64 w200 h999, 자세히 보기||%choices%
[6]. 레지키 존재확인 -> 있으면 밸류값 Msgbox로 보여주기
count=0
Loop, HKCR, DesktopBackground\shell\DISM_원키복원, 1
count:=A_INDEX
if count=0
{
GuiControl,, CopiedStatus, 〔DISM_원키복원〕레지 존재 안함. . . .
Sleep, 3000
GuiControl,, CopiedStatus,
Sleep, 500
}
else
{
Loop, HKCR, DesktopBackground\shell\DISM_원키복원\command, 1, 1
{
if a_LoopRegType = key
value =
else
{
RegRead, value
if ErrorLevel <> 0
value = *error*
}
MsgBox, %a_LoopRegName% = %value% (%a_LoopRegType%)
}
}