Quantcast
Channel: Indigo Rose Software Forums - Forums
Viewing all articles
Browse latest Browse all 2105

Convert BAT to Setup Factory

$
0
0
This is successful code for make Grub4DOS in bat file:

Code:

@echo off
BCDEDIT /export C:\Boot\BCD.meigyoku
for /f "tokens=3" %%A in ('BCDEDIT /create /application bootsector') do set guid=%%A
BCDEDIT /set %guid% device boot
BCDEDIT /set %guid% path \grldr.mbr
BCDEDIT /set %guid% description "Windows 7 PE"
BCDEDIT /displayorder %guid% /addlast

and I tried "convert" it:

Code:

BCD = "C:\\Windows\\System32\\bcdedit.exe"
CMD = "C:\\Windows\\System32\\cmd.exe"
File.Run(BCD, "/export \"C:\\Boot\\BCD.meigyoku\"", "", SW_SHOWNORMAL, true);
File.Run(CMD, "/C \"for /f \"tokens=3\" %%A in (\'\"C:\\Windows\\System32\\bcdedit.exe\" /create /application bootsector\') do set guid=%%A\"", "", SW_SHOWNORMAL, true);
File.Run(BCD, "/set %guid% device boot", "", SW_SHOWNORMAL, true);
File.Run(BCD, "/set %guid% path \grldr.mbr", "", SW_SHOWNORMAL, true);
File.Run(BCD, "/set %guid% description \"Windows 7 PE\"", "", SW_SHOWNORMAL, true);
File.Run(BCD, "/displayorder %guid% /addlast", "", SW_SHOWNORMAL, true);
File.Run(BCD, "/timeout 5", "", SW_SHOWNORMAL, true);

but not successful (only successful in line --File.Run(BCD, "/export \"C:\\Boot\\BCD.meigyoku\"", "", SW_SHOWNORMAL, true); Please tell me reason! (I think wrong code in line 4) Thank you in advanced!

Viewing all articles
Browse latest Browse all 2105

Latest Images

Trending Articles



Latest Images