English 中文(简体)
计算机重新启用后转稿
原标题:Resume batch script after computer restart

我拥有一台老机,运行Windows 2000 Pro和IE 5.0,我想用银灯提升到IE 6。 我从微软的网站上下载了IE6和银星安装器,幸运的是,它们都有指挥线选择,以便它们能够以“沉默方式”运行。

我将这两部指挥部放在了监督事务司的批号中,并管理着它,但是,IE6的安装者要求自动重新启用计算机,因此问题是如何恢复文字,并管理第二批指挥(当时是银星)。

我的批量档案现在非常简单:

ie6setup.exe /Q
silverlight.exe /q

根据我所知,批量档案在重新启用计算机后可能无法恢复执行。 是否有办法让他们这样做? 实现我需要的还有另一种方式。

谢谢。

最佳回答

您可将第二指挥部排在排他性批量档案中,并在视窗开始后自动执行这一批量档案,使silverlight在计算机重新启用后执行。

您是否听了msconfig? 在某些制度中,你正在研究:

HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun

但你可能要检查这一点。 如果你想用批量文件来书写登记册上的关键内容,你或许应当看

问题回答

根据Tim s员额,经测试后,在批量档案中添加了“2”后,未能找到“2”的批量标签,因此修改为阅读和复制;书写从纸面文档中产生的“现成”变量,使批量文档无法使用;

@echo off
call :Resume
goto %current%
goto :eof

:one
::Add script to Run key
reg add HKCUSoftwareMicrosoftWindowsCurrentVersionRun /v %~n0 /d %~dpnx0 /f
echo two >%~dp0current.txt
echo -- Section one --
pause
shutdown -r -t 0
goto :eof

:two
echo three >%~dp0current.txt
echo -- Section two --
pause
shutdown -r -t 0
goto :eof

:three
::Remove script from Run key
reg delete HKCUSoftwareMicrosoftWindowsCurrentVersionRun /v %~n0 /f
del %~dp0current.txt
echo -- Section three --
pause
goto :eof

:resume
if exist %~dp0current.txt (
    set /p current=<%~dp0current.txt
) else (
    set current=one
)

我知道它是一个老大事,但这项工作令人吃惊:

@echo off
call :Resume
goto %current%
goto :eof

:one
echo two >>myfile.cmd
::REBOOT HERE
goto :eof

:two
echo resumed here
goto :eof

:resume
rem THIS PART SHOULD BE AT THE BOTTOM OF THE FILE
set current=one
@echo off

set "_RunOnce=HKCUSoftwareMicrosoftWindowsCurrentVersionRunOnce"

rem./ :: if no argument was passed, this line will be ignored, but if so, it will be executed here == ^> & %~1

:1st_command
ie6Setup.exe /Q
shutdown -r -t 0 | reg add "%_RunOnce%" /v "%~n0" /d ""%~f0" "goto :2nd_command"" /f & goto :eof 

:2nd_command
SilverLight.exe /Q
timeout -1 | shutdown -r -t 0 | reg add "%_RunOnce%" /v "%~n0" /d ""%~f0" "goto :3rd_command"" /f & goto :eof 

:3rd_command
Skype-8.92.0.401.exe /VerySilent /NoRestart /SuppressMsgBoxes /DL=1 & goto :eof

可以在不产生或操纵其他档案中的读物、在钥匙上写字和读物,并利用执行中通过的论点来控制相关执行所必需的指挥,将gototor<>/code><>%1作为论点


@echo off

set "_RunOnce=HKCUSoftwareMicrosoftWindowsCurrentVersionRunOnce"

rem./ if no argument was passed, below will be ignored, but if so, it will be executed here == ^> & %~1

:1st_command
mode con cols=50 lines=1 | title starting %~1
start "google" /wait "c:program files (x86)GoogleChromeApplicationchrome.exe" "stackoverflow.com" /new-tab
timeout -1 | shutdown -r -t 0 | reg add "%_RunOnce%" /v "%~n0" /d ""%~f0" "goto :2nd_command"" /f & goto :eof 

:2nd_command
mode con cols=50 lines=1 | title starting %~1
start "google" /wait "c:program files (x86)GoogleChromeApplicationchrome.exe" "meta.stackexchange.com" /new-tab
timeout -1 | shutdown -r -t 0 | reg add "%_RunOnce%" /v "%~n0" /d ""%~f0" "goto :3rd_command"" /f & goto :eof 

:3rd_command
mode con cols=50 lines=1 | title %~1
start "google" /wait "c:program files (x86)GoogleChromeApplicationchrome.exe" "www.amazon.com" /new-tab
goto :eof 




相关问题
Why running a service as Local System is bad on windows?

I am trying to find out the difference between difference service account types. I tumbled upon this question. The answer was because it has powerful access to local resources, and Network Service ...

Programmatically detect Windows cluster configuration?

Does anyone know how to programatically detect that a Windows server is part of a cluster? Further, is it possible to detect that the server is the active or passive node? [Edit] And detect it from ...

get file icon for Outlook appointment (.msg)

I ve read Get File Icon used by Shell and the other similar posts - and already use SHFileInfo to get the associated icon for any given extension, and that works great. However, Outlook uses ".msg" ...

Identifying idle state on a windows machine

I know about the GetLastInputInfo method but that would only give me the duration since last user input - keyboard or mouse. If a user input was last received 10 minutes ago, that wouldn t mean the ...

Terminating a thread gracefully not using TerminateThread()

My application creates a thread and that runs in the background all the time. I can only terminate the thread manually, not from within the thread callback function. At the moment I am using ...

热门标签