【发布时间】:2013-09-19 19:15:44
【问题描述】:
我需要在安全模式下重启后运行一次进程,进程是这样的:
bcdedit.exe /import "%WINDIR%\Restore BootLoader Settings.bcd"
我尝试使用 RunOnce 密钥,但我注意到密钥在安全模式启动下不会运行,所以...是否存在任何其他方式来在安全模式启动下运行该死的进程?
更明确地说,这是我想要做的:
在正常模式或其他任何模式下,我都会导出所有引导加载程序条目的当前设置。
然后我更改当前引导加载程序条目的一些参数,然后重置 PC。
1234563 /p>
我该怎么做?
这是我的 vbs 脚本:
' Restart in Safe Mode
' By Elektro H@cker
If Not Msgbox( _
"¿Seguro que quieres reiniciar el equipo?", _
4 or 48, _
"Reiniciar en Modo Seguro..." _
) = vbNo _
Then
Set wshShell = WScript.CreateObject("WScript.Shell")
TempFile = """" & wshShell.ExpandEnvironmentStrings("%WINDIR%") & "\" & "Bcdedit settings.bcd" & """"
wshShell.Run "bcdedit /export " & TempFile, 0, True
wshShell.Run "bcdedit /set {current} safeboot minimal", 0, True
wshShell.RegWrite _
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\Restore BootLoader Settings", _
"bcdedit.exe /import " & TempFile, _
"REG_SZ"
wshShell.Run "shutdown -r -t 00 -f", 0, True
如果结束
【问题讨论】:
标签: windows vbscript console runonce bcdedit