如何添加“按任意键从 USB 启动”从闪存驱动器安装 Windows 时? (Grub4dos 问题/如何删除引导加载程序)

发布于 2024-10-11 23:03:38 字数 1015 浏览 7 评论 0原文

我已经被这个问题困扰了一段时间,最后决定寻求帮助。让我首先解释一下该应用程序的主要目的是什么:提供一种非常易于使用的方式来备份文件,然后格式化驱动器并启动 Windows 7 安装程序。

我通过启动 WinPE 来完成此操作,WinPE 运行脚本来检测 Windows 安装,然后打开文件浏览器。文件浏览器关闭后,脚本将继续并格式化包含 Windows 安装的驱动器,并启动无人值守的 Windows 7 安装。现在的问题是:

当您从 DVD 启动 Windows 安装程序或 WinPE 时,您会得到一个不错的选项“按任意键从 DVD 启动”。这是为了防止在安装的第一阶段完成并且计算机重新启动时计算机无法启动 DVD。但是,当从闪存驱动器启动时,Windows 不提供此选项:它只是在每次重新启动时启动闪存驱动器。

为了复制“按任意键”功能,我安装了 Grub4Dos,效果很好。它提供了一个小菜单,第一个标准项是“继续安装”,第二个是“开始安装”。 经过大量调整后,一切正常:开始安装启动 WinPE,WinPE 又启动 Windows 安装。第一次重新启动时,Grub4Dos 菜单出现,计时 5 秒并启动安装的第二阶段。在这里,我遇到了错误:

“Windows 安装程序无法将 Windows 配置为在此计算机的硬件上运行。”

当我以正常方式启动到 WinPE(将 bootmgr 放在 root 上)并将我的 BIOS 更改为在第一次重新启动后从主硬盘启动时,我没有收到此错误。

我一直在寻找,唯一能发现的是BIOS自动将启动设备命名为hd0,并且Windows只能运行/安装到hd 0。我不确定这是否是问题所在。 我读到了有关重新映射来解决此问题的信息,但要做到这一点,您必须知道硬盘驱动器和分区的物理位置,例如 hd(0,1)。我希望这个闪存驱动器可以在任何 PC 上运行,无论操作系统安装在哪里,所以这实际上是不可能的。

我想到的一个可能的修复方法是,当我在 WinPE 中时,从闪存驱动器中删除引导加载程序。这样,当电脑重新启动时,BIOS 不会将闪存驱动器视为启动驱动器,而是启动主硬盘。我还没有找到办法做到这一点。

感谢您阅读我的问题,如果您有任何建议,请提出。

I've been struggling with this problem for a while now and finially decided to ask for help. Let me first explain what the main purpose of the app is: to provide the a very easy to use way of backing up files, after which I format the drive and start Windows 7 setup.

I do this by booting WinPE, which runs a script to detect Windows installations and then opens a file browser. After the file browser is closed, the script continues and formats the drive that contains the Windows installation, and starts an unattended Windows 7 install. Now here is the problem:

When you start Windows setup or WinPE from a dvd, you get a nice option to "Press any key to boot from DVD". This is to prevent the computer from booting the DVD when the first phase of the installation is complete and the computer reboots. However, when booting from a flash drive, Windows does not provide this option: it simply boots the flash drive every reboot.

To replicate the "press any key" function, I installed Grub4Dos, which works great. It provides a small menu, the first standard item being "Continue installation", the second being "start installation".
After quite a lot of tweaking, I got everything working: Start installation starts WinPE, which in turn starts the Windows installation. At first reboot, the Grub4Dos menu comes up, counts 5 seconds and boots the second stage of the installation. Here, I am greeted with the error:

"Windows setup could not configure windows to run on this computer's hardware."

When I boot into WinPE the normal way (put the bootmgr on the stick root) and change my bios to boot from the primary hdd after first reboot, I don't get this error.

I've been looking around, and the only thing I could find was that the BIOS automatically names the boot device hd0, and that Windows can only be run / installed to hd 0. I'm not sure if this is the problem.
I read about remapping to solve this problem, but to do that you have to know the phisical location of the hard drive and partition, like hd(0,1). I want this flash drive to work on any PC, regardless of where the OS is installed, so that's not really a possibility.

A possible fix I thought of is removing the bootloader from the flash drive when I'm in WinPE. That way, when the pc reboots the BIOS will not see the flash drive as a boot drive and instead boot the primary hdd. I have yet to find a way to do this.

Thank you for reading my question, and if you have any suggestion, please do.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

素食主义者 2024-10-18 23:03:38

只是想说我修好了。我首先尝试手动进行高清映射,这似乎解决了这个问题。然后我寻找一种自动化的方法,并想出了这个:
在 WinPE 中,我将文件 \ecu\ditis7.txt 写入要安装 Windows 的驱动器。然后我使用这个 Grub4Dos 代码:

标题继续 Windows 7 安装
查找 --set-root /ecu/ditis7.txt
地图 () (hd0)
chainloader /bootmgr

这解决了它。不敢相信事情就这么简单:)

Just wanted to say I fixed it. I first tried to manually do the hd mapping, which seemed to solve it. I then searched for a way to automate this, and came up with this:
In WinPE, I write a file \ecu\ditis7.txt to the drive Windows is about to be installed to. Then I use this Grub4Dos code:

title Continue Windows 7 installation
find --set-root /ecu/ditis7.txt
map () (hd0)
chainloader /bootmgr

And that fixed it. Can't believe it was that simple :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文