Batch: modify the system time

Batch: Modify the system time (STATA software upgrade)

@echo off
echo. date > mydate
date 2018-1-1
start  StataMP-64.exe 
pause
dir mydate | find "mydate" | date
del mydate
exit

or

@echo off
title STATA 运行前将系统时间修改 运行后恢复系统时间
color 8a&mode con: cols=40 lines=5
set a=%date%
date 2018-01-01
start "" "D:\ProgramFiles\ACsoft\Stata15\StataMP-64.exe"
echo:STATA 运行前将系统时间修改 运行后恢复系统时间
:open
tasklist |find "StataMP-64.exe" /i>nul 2>nul
if "%errorlevel%"=="1" goto xg
goto open
:xg
date %a%
exit

Guess you like

Origin www.cnblogs.com/ourweiguan/p/10982928.html