forked from auspbro/batch-snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
478 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
sel disk 0 | ||
sel par 3 | ||
shrink desired=4096 | ||
create part pri | ||
sel par 6 | ||
format FS=NTFS QUICK COMPRESS | ||
assign letter=d | ||
exit |
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
@echo on | ||
goto fixusb | ||
title Basic Set | ||
|
||
set UAC=0 | ||
bcdedit>nul | ||
if errorlevel 1 set uac=1 | ||
if %uac% ==1 ( | ||
echo Please Run as administrator | ||
pause | ||
goto :eof | ||
) | ||
|
||
echo= | ||
echo Set test mode. | ||
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\control\7503491f-4a39-4f84-b231-8aca3e203b94 | ||
echo Set test mode successful | ||
timeout 2 >nul | ||
|
||
|
||
echo= | ||
Echo Close UAC | ||
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\ /V EnableLUA /T REG_DWORD /D 0 /F | ||
echo Set UAC close successful | ||
timeout 2 >nul | ||
|
||
:fixUSB | ||
COPY fixUSB.EXE C:\ /y | ||
fixUSB.exe U | ||
|
||
:DetDrvU | ||
echo list vol > vol.log | ||
diskpart /s vol.log > listvol.log | ||
find /i "Volume 1 D" listvol.log | ||
if not errorlevel 1 goto CpFile | ||
goto CreatDrvD | ||
|
||
|
||
:CreatDrvD | ||
diskpart /s CrePar.txt | ||
goto CpFile | ||
|
||
:CpFile | ||
pause | ||
rem xcopy | ||
rem ghost32.exe -clone,mode=pload,src=u:\OBETEST.GHO:1,dst=1:2 -fx -sure | ||
|
||
:end |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
@echo off | ||
PAUSE | ||
|
||
:CheckTestStand | ||
tasklist|find /i "TestStand.exe" && goto PlugUSBKey | ||
rem taskkill /f /im "TestStand.exe" | ||
timeout 1 | ||
cd C:\Testprogram\QF7\SLT2\TestStand | ||
start TestStand.exe | ||
|
||
:PlugUSBKey | ||
timeout 3 | ||
cd C:\Testprogram\QF7\SLT2 | ||
msg.exe "请插入Runin启动U盘到这台电脑!" 5 700 200 12 | ||
pause | ||
|
||
cd C:\Testprogram\QF7\SLT2 | ||
call .\process\DVSN.BAT | ||
set BAT_DIR=C:\Testprogram\QF7\SLT2 | ||
set LOG_DIR=C:\Testprogram\QF7\SLT2\LOG | ||
|
||
:Test_Start | ||
timeout /nobreak 1 | ||
|
||
:RUNIN_CHECK | ||
set msg=SLT2_RUNIN_CHECK | ||
find /i "BURNIN_TEST=PASS: test completed successfully" C:\Testprogram\QF7\SLT2\RUNIN_LOG\burnin_%tmSN%_*.log | ||
if not errorlevel 1 goto pass | ||
goto fail | ||
|
||
:pass | ||
color 0f | ||
>.\log\SLT2_RUNIN_CHECK_LogCheck.bat echo set SLT2_RUNIN_CHECK_TestResult=PASS | ||
cd process | ||
call sdtCheckLog.exe QF7_SLT2.cfg SLT2_RUNIN_CHECK | ||
goto end | ||
|
||
:fail | ||
color 0C | ||
type ..\log\FailLog.txt | ||
pause | ||
pause | ||
del ..\log\FailLog.txt | ||
goto end | ||
|
||
:end |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@echo on | ||
rem command prompt run in backgroud... | ||
if "%1" == "h" goto start | ||
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit | ||
|
||
|
||
:start | ||
title WiFi SSID Connect | ||
netsh wlan show Interfaces >WlanInterface.txt | ||
find /i "hellosw" WlanInterface.txt | ||
if errorlevel 1 goto netsh | ||
goto end | ||
|
||
|
||
:netsh | ||
netsh wlan connect name="hellosw" ssid="hellosw" | ||
goto start | ||
|
||
:end | ||
echo Waiting For One Hour... | ||
timeout /t 1800 /nobreak | ||
goto start |
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
@echo off | ||
|
||
setlocal enabledelayedexpansion | ||
if exist c:\NetworkProfile.log del c:\NetworkProfile.log | ||
if exist c:\interface.bat del c:\interface.bat | ||
|
||
timeout 1 | ||
|
||
netsh interface show interface >c:\NetworkProfile.log | ||
:: 根据log中英文字符串判断系统语言 | ||
find /i "Admin State" c:\NetworkProfile.log | ||
if not errorlevel 1 goto OS_EN | ||
goto OS_CN | ||
|
||
:OS_EN | ||
set n=0 | ||
for /f "skip=3 tokens=4,* delims= " %%i in (c:\NetworkProfile.log) do ( | ||
set /a n+=1 | ||
if '!n!'=='1' echo set interface1=%%i %%j >>c:\interface.bat | ||
if '!n!'=='2' echo set interface2=%%i %%j >>c:\interface.bat | ||
if '!n!'=='3' echo set interface3=%%i %%j >>c:\interface.bat | ||
if '!n!'=='4' echo set interface4=%%i %%j >>c:\interface.bat | ||
if '!n!'=='5' echo set interface5=%%i %%j >>c:\interface.bat | ||
if '!n!'=='6' echo set interface6=%%i %%j >>c:\interface.bat | ||
) | ||
|
||
call c:\interface.bat | ||
|
||
|
||
:: 在组策略中配置关机脚本,开始-运行-GPEDIT.MSC,计算机配置→Windows设置-脚本-关机,浏览选择此脚本文件. | ||
:: Reboot之前禁用本地连接 | ||
:: 中英文系统log中变量的空格数不一样,中文两个空格,英文一个空格 | ||
netsh interface set interface "%interface1:~0,-1%" disabled | ||
netsh interface set interface "%interface2:~0,-1%" disabled | ||
netsh interface set interface "%interface3:~0,-1%" disabled | ||
netsh interface set interface "%interface4:~0,-1%" disabled | ||
netsh interface set interface "%interface5:~0,-1%" disabled | ||
netsh interface set interface "%interface6:~0,-1%" disabled | ||
goto end | ||
|
||
:OS_CN | ||
set n=0 | ||
for /f "skip=3 tokens=4,* delims= " %%i in (c:\NetworkProfile.log) do ( | ||
set /a n+=1 | ||
if '!n!'=='1' echo set interface1=%%i %%j >>c:\interface.bat | ||
if '!n!'=='2' echo set interface2=%%i %%j >>c:\interface.bat | ||
if '!n!'=='3' echo set interface3=%%i %%j >>c:\interface.bat | ||
if '!n!'=='4' echo set interface4=%%i %%j >>c:\interface.bat | ||
if '!n!'=='5' echo set interface5=%%i %%j >>c:\interface.bat | ||
if '!n!'=='6' echo set interface6=%%i %%j >>c:\interface.bat | ||
) | ||
|
||
call c:\interface.bat | ||
|
||
|
||
:: 在组策略中配置关机脚本,开始-运行-GPEDIT.MSC,计算机配置→Windows设置-脚本-关机,浏览选择此脚本文件. | ||
:: Reboot之前禁用本地连接 | ||
:: 中英文系统log中变量的空格数不一样,中文两个空格,英文一个空格 | ||
netsh interface set interface "%interface1:~0,-2%" disabled | ||
netsh interface set interface "%interface2:~0,-2%" disabled | ||
netsh interface set interface "%interface3:~0,-2%" disabled | ||
netsh interface set interface "%interface4:~0,-2%" disabled | ||
netsh interface set interface "%interface5:~0,-2%" disabled | ||
netsh interface set interface "%interface6:~0,-2%" disabled | ||
goto end | ||
|
||
|
||
:end |
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
@echo off | ||
setlocal enabledelayedexpansion | ||
if exist c:\NetworkProfile.log del c:\NetworkProfile.log | ||
if exist c:\interface.bat del c:\interface.bat | ||
|
||
timeout 1 | ||
|
||
netsh interface show interface >c:\NetworkProfile.log | ||
:: 根据log中英文字符串判断系统语言 | ||
find /i "Admin State" c:\NetworkProfile.log | ||
if not errorlevel 1 goto OS_EN | ||
goto OS_CN | ||
|
||
:OS_EN | ||
set n=0 | ||
for /f "skip=3 tokens=4,* delims= " %%i in (c:\NetworkProfile.log) do ( | ||
set /a n+=1 | ||
if '!n!'=='1' echo set interface1=%%i %%j >>c:\interface.bat | ||
if '!n!'=='2' echo set interface2=%%i %%j >>c:\interface.bat | ||
if '!n!'=='3' echo set interface3=%%i %%j >>c:\interface.bat | ||
if '!n!'=='4' echo set interface4=%%i %%j >>c:\interface.bat | ||
if '!n!'=='5' echo set interface5=%%i %%j >>c:\interface.bat | ||
if '!n!'=='6' echo set interface6=%%i %%j >>c:\interface.bat | ||
) | ||
|
||
call c:\interface.bat | ||
|
||
|
||
:: 在组策略中配置关机脚本,开始-运行-GPEDIT.MSC,计算机配置→Windows设置-脚本-关机,浏览选择此脚本文件. | ||
:: Reboot之前禁用本地连接 | ||
:: 中英文系统log中变量的空格数不一样,中文两个空格,英文一个空格 | ||
netsh interface set interface "%interface1:~0,-1%" enabled | ||
netsh interface set interface "%interface2:~0,-1%" enabled | ||
netsh interface set interface "%interface3:~0,-1%" enabled | ||
netsh interface set interface "%interface4:~0,-1%" enabled | ||
netsh interface set interface "%interface5:~0,-1%" enabled | ||
netsh interface set interface "%interface6:~0,-1%" enabled | ||
goto end | ||
|
||
:OS_CN | ||
set n=0 | ||
for /f "skip=3 tokens=4,* delims= " %%i in (c:\NetworkProfile.log) do ( | ||
set /a n+=1 | ||
if '!n!'=='1' echo set interface1=%%i %%j >>c:\interface.bat | ||
if '!n!'=='2' echo set interface2=%%i %%j >>c:\interface.bat | ||
if '!n!'=='3' echo set interface3=%%i %%j >>c:\interface.bat | ||
if '!n!'=='4' echo set interface4=%%i %%j >>c:\interface.bat | ||
if '!n!'=='5' echo set interface5=%%i %%j >>c:\interface.bat | ||
if '!n!'=='6' echo set interface6=%%i %%j >>c:\interface.bat | ||
) | ||
|
||
call c:\interface.bat | ||
|
||
|
||
:: 在组策略中配置关机脚本,开始-运行-GPEDIT.MSC,计算机配置→Windows设置-脚本-开机,浏览选择此脚本文件. | ||
:: Reboot之后启用本地连接 | ||
:: 中英文系统log中变量的空格数不一样,中文两个空格,英文一个空格 | ||
netsh interface set interface "%interface1:~0,-2%" enabled | ||
netsh interface set interface "%interface2:~0,-2%" enabled | ||
netsh interface set interface "%interface3:~0,-2%" enabled | ||
netsh interface set interface "%interface4:~0,-2%" enabled | ||
netsh interface set interface "%interface5:~0,-2%" enabled | ||
netsh interface set interface "%interface6:~0,-2%" enabled | ||
goto end | ||
|
||
|
||
:end |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@echo on | ||
|
||
:start | ||
timeout 300 | ||
route delete 0.0.0.0 | ||
timeout 1 | ||
route add 172.20.155.0 mask 255.255.255.0 172.20.155.1 -p | ||
timeout 1 | ||
rem route add 0.0.0.0 mask 0.0.0.0 192.168.2.1 -p | ||
route add 0.0.0.0 mask 0.0.0.0 192.168.1.1 -p | ||
route add 0.0.0.0 mask 0.0.0.0 192.168.0.1 -p | ||
rem route add 0.0.0.0 mask 0.0.0.0 192.168.23.1 -p | ||
goto end | ||
|
||
route add 172.20.0.0 mask 255.255.0.0 172.20.140.254 | ||
route add 172.20.140.0 mask 255.255.255.0 172.20.140.254 | ||
route add 172.20.153.0 mask 255.255.255.0 172.20.153.242 | ||
|
||
|
||
:end | ||
goto start | ||
|
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@echo off | ||
|
||
|
||
:ChkCycles | ||
call d:\win\loopcounts.bat | ||
if "%loopcounts%" == "5" goto start | ||
shutdown.exe -r -t 20 | ||
echo set /a loopcounts=%loopcounts%+1 >d:\win\loopcounts.bat | ||
pause | ||
|
||
:start |
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@echo off | ||
|
||
::Author : Capt. | ||
::Mailto : [email protected] | ||
::Version : 1.0 | ||
::Create : 2016/05/26 | ||
::Windows做循环reboot并可以设定次数 | ||
|
||
:: 根据test.log中空格的数量来表示reboot次数 | ||
type test.log | find /c /v "" > count.bat | ||
find /i "20" count.bat | ||
if not errorlevel 1 goto end | ||
goto start | ||
|
||
:start | ||
timeout 10 | ||
start /w shutdown /r /t 5 | ||
echo ***%date% %time%*** >> test.log | ||
goto end | ||
|
||
:end |
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
@echo off | ||
|
||
title Basic set | ||
|
||
|
||
set UAC=0 | ||
bcdedit>nul | ||
if errorlevel 1 set uac=1 | ||
if %uac% ==1 ( | ||
echo Please Run as administrator | ||
pause | ||
goto :eof | ||
) | ||
|
||
echo= | ||
echo Set enter desktop after logon | ||
(echo [Shell] | ||
echo Command=2 | ||
echo IconFile=Explorer.exe,3 | ||
echo [Taskbar] | ||
echo Command=ToggleDesktop | ||
)>>"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\desktop.scf" | ||
echo Set enter desktop successful | ||
timeout 2 >nul | ||
|
||
|
||
|
||
echo= | ||
echo Set test mode. | ||
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\control\7503491f-4a39-4f84-b231-8aca3e203b94 | ||
echo Set test mode successful | ||
timeout 2 >nul | ||
|
||
|
||
echo= | ||
Echo Close UAC | ||
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\ /V EnableLUA /T REG_DWORD /D 0 /F | ||
echo Set UAC close successful | ||
timeout 2 >nul | ||
|
||
|
||
echo= | ||
Echo Set power status | ||
|
||
POWERCFG /CHANGE /monitor-timeout-dc 0 | ||
POWERCFG /CHANGE /monitor-timeout-ac 0 | ||
POWERCFG /CHANGE /disk-timeout-ac 0 | ||
POWERCFG /CHANGE /disk-timeout-dc 0 | ||
POWERCFG /CHANGE /standby-timeout-ac 0 | ||
POWERCFG /CHANGE /standby-timeout-dc 0 | ||
POWERCFG /CHANGE /hibernate-timeout-ac 0 | ||
POWERCFG /CHANGE /hibernate-timeout-dc 0 | ||
echo Set power status successful | ||
echo= | ||
echo All set finished | ||
echo Will restart OS | ||
pause | ||
shutdown -r -t 0 | ||
|
Oops, something went wrong.