Skip to content

Commit

Permalink
add new batch files
Browse files Browse the repository at this point in the history
  • Loading branch information
auspbro committed Aug 31, 2017
1 parent 6fa6a47 commit 0745be1
Show file tree
Hide file tree
Showing 14 changed files with 478 additions and 0 deletions.
8 changes: 8 additions & 0 deletions NB1_SW/obe-auto/CrePar.txt
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 added NB1_SW/obe-auto/FixUSB.exe
Binary file not shown.
48 changes: 48 additions & 0 deletions NB1_SW/obe-auto/Setup.bat
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
46 changes: 46 additions & 0 deletions NB1_SW/qf7/SLT2_RUNIN_CHECK.bat
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
22 changes: 22 additions & 0 deletions life-hack/AutoConnectWIFI.bat
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
68 changes: 68 additions & 0 deletions life-hack/DisNetwork.BAT
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
67 changes: 67 additions & 0 deletions life-hack/EnNetwork.BAT
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
22 changes: 22 additions & 0 deletions life-hack/RouterX.bat
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

11 changes: 11 additions & 0 deletions life-hack/Setting_Windows_Reboot_Cycle.bat
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 added life-hack/TestMode.reg
Binary file not shown.
21 changes: 21 additions & 0 deletions life-hack/Windows_Warmboot_Cycle.bat
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
59 changes: 59 additions & 0 deletions life-hack/basicset.bat
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

Loading

0 comments on commit 0745be1

Please sign in to comment.