-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1900 from luckyh/winupdate
finish.bat: Add optional step to accomplish windows updates
- Loading branch information
Showing
2 changed files
with
48 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,44 @@ | ||
taskkill /IM serialport.exe /F | ||
|
||
:check_net | ||
if [%2]==[] goto check_process | ||
|
||
set ping_host=%2 | ||
echo Check network status > COM1 | ||
ping %ping_host% | ||
|
||
if errorlevel 1 goto check_net | ||
|
||
:check_process | ||
if [%1]==[] goto end | ||
|
||
set process=%1 | ||
echo Check %process% status > COM1 | ||
tasklist /FO List> C:\log | ||
type C:\log|find "%process%" | ||
|
||
if errorlevel 1 goto end | ||
if errorlevel 0 goto check_process | ||
|
||
:end | ||
reg add "HKLM\System\CurrentControlSet\Control\CrashControl" /v AutoReboot /d 0 /t REG_DWORD /f | ||
reg add "HKLM\System\CurrentControlSet\Control\CrashControl" /v CrashDumpEnabled /d 2 /t REG_DWORD /f | ||
reg add "HKLM\System\CurrentControlSet\Control\CrashControl" /v NMICrashDump /d 1 /t REG_DWORD /f | ||
reg add "HKLM\System\CurrentControlSet\Control\CrashControl" /v DumpFile /d %SystemRoot%\Memory.dmp /t REG_EXPAND_SZ /f | ||
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v bsod /d "D:\autoit3.exe D:\dump_control.au3" /t REG_SZ /f | ||
reg add "HKLM\System\CurrentControlSet\Control\CrashControl" /v AlwaysKeepMemoryDump /d 1 /t REG_DWORD /f | ||
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\Windows Error Reporting" /v Disabled /d 1 /t REG_DWORD /f | ||
reg add "HKLM\SYSTEM\CurrentControlSet\Services\vds" /v Start /t REG_DWORD /d 3 /f | ||
|
||
for /L %%i in (1,1,3) do (echo Post set up finished> COM1) | ||
taskkill /IM serialport.exe /F | ||
|
||
if [%~3]==[-AccomplishWinUpdates] ( | ||
set has_update=1 | ||
) else ( | ||
set has_update=0 | ||
) | ||
|
||
:check_net | ||
if [%~2]==[] goto check_process | ||
|
||
set ping_host=%~2 | ||
echo Check network status > COM1 | ||
ping %ping_host% | ||
|
||
if errorlevel 1 goto check_net | ||
|
||
:check_process | ||
if [%~1]==[] goto end | ||
|
||
set process=%~1 | ||
echo Check %process% status > COM1 | ||
tasklist /FO List> C:\log | ||
type C:\log|find "%process%" | ||
|
||
if errorlevel 1 goto end | ||
if errorlevel 0 goto check_process | ||
|
||
:end | ||
reg add "HKLM\System\CurrentControlSet\Control\CrashControl" /v AutoReboot /d 0 /t REG_DWORD /f | ||
reg add "HKLM\System\CurrentControlSet\Control\CrashControl" /v CrashDumpEnabled /d 2 /t REG_DWORD /f | ||
reg add "HKLM\System\CurrentControlSet\Control\CrashControl" /v NMICrashDump /d 1 /t REG_DWORD /f | ||
reg add "HKLM\System\CurrentControlSet\Control\CrashControl" /v DumpFile /d %SystemRoot%\Memory.dmp /t REG_EXPAND_SZ /f | ||
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v bsod /d "D:\autoit3.exe D:\dump_control.au3" /t REG_SZ /f | ||
reg add "HKLM\System\CurrentControlSet\Control\CrashControl" /v AlwaysKeepMemoryDump /d 1 /t REG_DWORD /f | ||
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\Windows Error Reporting" /v Disabled /d 1 /t REG_DWORD /f | ||
reg add "HKLM\SYSTEM\CurrentControlSet\Services\vds" /v Start /t REG_DWORD /d 3 /f | ||
|
||
if [%has_update%]==[1] ( | ||
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v PostSetupEvent /d "cmd /c """for %%i in ^(1,1,5^) do ^(echo Post set up finished^> COM1^)"" /t REG_SZ /f | ||
shutdown /r /f /t 0 | ||
) else ( | ||
for /L %%i in (1,1,3) do (echo Post set up finished> COM1) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters