Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to run cmd file
#1
Hello everyone, I want to use QM to run the cmd file, but it can't run normally. It is normal to directly run the cmd file with a double mouse click. I hope someone can help me, thanks in advance.


cmd file:
__________________________________________________________

cd C:\Windows\System32
bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set {ramdiskoptions} ramdisksdidevice boot
bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set {ramdiskoptions} ramdisksdipath \EFI\BOOT\BOOT.sdi

for /f "delims={,} tokens=2" %%a in ('bcdedit /store Z:\EFI\Microsoft\Boot\BCD /create /d "add itm" /application  osloader') do set Guid={%%a}
bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set %Guid% device boot
bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set %Guid% device ramdisk="[boot]\EFI\BOOT\BOOT.wim,{ramdiskoptions}"
bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set %Guid% osdevice ramdisk="[boot]\EFI\BOOT\BOOT.wim,{ramdiskoptions}"
bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set %Guid% path \windows\system32\boot\winload.efi
bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set %Guid% locale zh-CN
bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set %Guid% inherit {bootloadersettings}
bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set %Guid% systemroot \windows
bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set %Guid% BootMenuPolicy Legacy
bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set %Guid% detecthal yes
bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set %Guid% winpe yes
bcdedit /store Z:\EFI\Microsoft\Boot\BCD /displayorder %Guid% -addlast
bcdedit /store Z:\EFI\Microsoft\Boot\BCD /timeout 8

pause


Attached Files Image(s)
       
#2
http://www.quickmacros.com/forum/showthr...p?tid=6570

In the above case, used the full path to solve the problem, but my problem still can't be solved. Huh  I hope the developer can help me, thank you.

The following code uses an absolute path and still complains Huh

Macro Macro5
Code:
Copy      Help
str be="C:\Windows\System32\bcdedit.exe"
str url="Z:\EFI\Microsoft\Boot\BCD"
out url
str s=
F
;{be} /store {url} /set {{ramdiskoptions} ramdisksdidevice boot
;{be} /store {url} /set {{ramdiskoptions} ramdisksdipath \EFI\BOOT\BOOT.sdi
;
;for /f "delims={{,} tokens=2" %%a in ('{be} /store {url} /create /d "GPT+PE" /application  osloader') do set Guid={{%%a}
;{be} /store {url} /set %Guid% device boot
;{be} /store {url} /set %Guid% device ramdisk="[boot]\EFI\BOOT\BOOT.wim,{{ramdiskoptions}"
;{be} /store {url} /set %Guid% osdevice ramdisk="[boot]\EFI\BOOT\BOOT.wim,{{ramdiskoptions}"
;{be} /store {url} /set %Guid% path \windows\system32\boot\winload.efi
;{be} /store {url} /set %Guid% locale zh-CN
;{be} /store {url} /set %Guid% inherit {{bootloadersettings}
;{be} /store {url} /set %Guid% systemroot \windows
;{be} /store {url} /set %Guid% BootMenuPolicy Legacy
;{be} /store {url} /set %Guid% detecthal yes
;{be} /store {url} /set %Guid% winpe yes
;{be} /store {url} /displayorder %Guid% -addlast
;{be} /store {url} /timeout 8

out s
__TempFile f.Init(".bat" "" "" s)
RunConsole2 f
#3
I guess the system folder should be sysnative, not System32.
#4
@[b]Gintaras[/b]
I tried many times and found that only copying bcdedit.exe to a non-system directory can run successfully.

I have a question now, how do I get the actual full path for $desktop$ or $qm$   Huh


Macro Macro5
Code:
Copy      Help
str be="C:\Users\Administrator\Desktop\bcdedit.exe" ;;The result is successful
;str be="$desktop$\bcdedit.exe" ;;The result is a failure
;str be="$qm$\bcdedit.exe" ;;The result is a failure
;str be="C:\Windows\System32\bcdedit.exe" ;;The result is a failure
str url="Z:\EFI\Microsoft\Boot\BCD"
out url
str s=
F
;{be} /store {url} /set {{ramdiskoptions} ramdisksdidevice boot
;{be} /store {url} /set {{ramdiskoptions} ramdisksdipath \EFI\BOOT\BOOT.sdi
;
;for /f "delims={{,} tokens=2" %%a in ('{be} /store {url} /create /d "GPT+PE" /application  osloader') do set Guid={{%%a}
;{be} /store {url} /set %Guid% device boot
;{be} /store {url} /set %Guid% device ramdisk="[boot]\EFI\BOOT\BOOT.wim,{{ramdiskoptions}"
;{be} /store {url} /set %Guid% osdevice ramdisk="[boot]\EFI\BOOT\BOOT.wim,{{ramdiskoptions}"
;{be} /store {url} /set %Guid% path \windows\system32\boot\winload.efi
;{be} /store {url} /set %Guid% locale zh-CN
;{be} /store {url} /set %Guid% inherit {{bootloadersettings}
;{be} /store {url} /set %Guid% systemroot \windows
;{be} /store {url} /set %Guid% BootMenuPolicy Legacy
;{be} /store {url} /set %Guid% detecthal yes
;{be} /store {url} /set %Guid% winpe yes
;{be} /store {url} /displayorder %Guid% -addlast
;{be} /store {url} /timeout 8

out s
__TempFile f.Init(".bat" "" "" s)
RunConsole2 f


Forum Jump:


Users browsing this thread: 1 Guest(s)