====== 启动或关闭teamviewer ======
@ECHO off
START D:\soft\TeamViewer\TeamViewer.exe
@ECHO off
FOR /f "tokens=1,2,10,11 delims= " %%l IN ('tasklist /v') DO (
ECHO "%%l - %%m - %%n - %%o"
IF "%%l" == "TeamViewer.exe" taskkill /f /PID %%m
)
schtasks /create /tn "start teamviewer" /tr "cmd /c D:\download\batch\start-teamviewer.bat" /sc daily /st 19:40
schtasks /create /tn "stop teamviewer" /tr "cmd /c D:\download\batch\stop-teamviewer.bat" /sc daily /st 03:30
不知道为什么下面的命令 居然不生效,所以 就用schtasks 来替代了at
at 11:16 /every:m,t,w,th,f,s,st D:\download\batch\start-teamviewer.bat
at 11:11 /every:,t,w,th,f,s,su D:\download\batch\stop-teamviewer.bat
@echo off
for /f "tokens=1,2,10,11 delims= " %%l in ('tasklist /v') do (
echo "%%l - %%m - %%n - %%o"
if "%%l" == "chromedriver.exe" taskkill /f /PID %%m
)
====== SVN update ======
@ECHO off
CD /D %~dp0
SET currentPath=%~dp0
SET logFile=%currentPath%platformCheckout.log
SET listFile=%currentPath%platformList.txt
SET listFile2=%currentPath%platformOtherList.txt
SET rootFolder=platform
SET svnBaseURL=https://morgan0329.googlecode.com/svn/%rootFolder%
IF EXIST %logFile% DEL %logFile%
IF NOT EXIST %currentPath%%rootFolder% MKDIR %currentPath%%rootFolder%
FOR /F "tokens=1,2,3,4* delims=," %%A IN (%listFile%) DO (
MKDIR %currentPath%%rootFolder%\%%A
MKDIR %currentPath%%rootFolder%\%%A\trunk\
ECHO #### [%%A] Checkout Started #####>>%logFile%
svn checkout %svnBaseURL%/%%A/trunk/ %currentPath%%rootFolder%\%%A\trunk\ >>%logFile%
ECHO #### [%%A] Checkout Finished ####>>%logFile%
)
FOR /F "tokens=1,2,3,4* delims=," %%A IN (%listFile2%) DO (
MKDIR %currentPath%%rootFolder%\%%A
ECHO #### [%%A] Checkout Started #####>>%logFile%
svn checkout %svnBaseURL%/%%A/ %currentPath%%rootFolder%\%%A\ >>%logFile%
ECHO #### [%%A] Checkout Finished ####>>%logFile%
)
@ECHO off
CD /D %~dp0
SET currentPath=%~dp0
SET logFile=%currentPath%platformUpdate.log
SET listFile=%currentPath%platformList.txt
SET listFile2=%currentPath%platformOtherList.txt
SET rootFolder=platform
SET svnBaseURL=https:///%rootFolder%
IF EXIST %logFile% DEL %logFile%
IF NOT EXIST %currentPath%%rootFolder% MKDIR %currentPath%%rootFolder%
FOR /F "tokens=1,2,3,4* delims=," %%A IN (%listFile%) DO (
IF EXIST %currentPath%%rootFolder%\%%A\trunk\ (
ECHO #### [%%A] Update Started #####>>%logFile%
svn update %currentPath%%rootFolder%\%%A\trunk\ >>%logFile%
ECHO #### [%%A] Update Finished ####>>%logFile%
)
)
@ECHO off
CD /D %~dp0
SET currentPath=%~dp0
SET logFile=%currentPath%delete.log
SET listFile=%currentPath%deleteList.txt
IF EXIST %logFile% DEL %logFile%
IF EXIST %listFile% DEL %listFile%
DIR %currentPath%platform /A:D /B>>%listFile%
FOR /F "tokens=1,2,3,4* delims=," %%A IN (%listFile%) DO (
ECHO #### [%%A] Updating Started #####>>%logFile%
ECHO Y | RMDIR %currentPath%platform\%%A /s>>%logFile%
ECHO #### [%%A] Updating Finished ####>>%logFile%
)
IF EXIST %listFile% DEL %listFile%
kk
ll
mm
sfds
sdfsdf
sdfd
sfafs
mm
nn
kk
ll
====== SVN Move ======
@ECHO off
REM SET fromURL=branches/
REM SET toURL=ReleasedBranch/
IF "%1"=="" (
SET /p fromURL=Enter From URL:
) ELSE (
SET fromURL=%1
)
IF "%2"=="" (
SET /p toURL=Enter To URL:
) ELSE (
SET toURL=%2
)
CD /D %~dp0
SET currentPath=%~dp0
SET logFile=%currentPath%moveSVNFolder.log
SET listFile=%currentPath%svnList.txt
IF EXIST %logFile% DEL %logFile%
FOR /F "tokens=1,2,3,4* delims=," %%A IN (%listFile%) DO (
ECHO #### [%%A] Movement Started #####>>%logFile%
svn move %fromURL%%%A %toURL%%%A -m "move it to">>%logFile%
ECHO #### [%%A] Movement Finished ####>>%logFile%
)