bat效率低而且精度差,最好用编程实现。- call :mutexLock
- abc.exe 1111 >1.txt
- call :mutexUnlock
- goto :eof
-
-
- goto :eof
- :mutexLock
- if not exist "%temp%\abc.lock" (cd.>"%temp%\abc.lock" & goto :eof)
- ping.exe -n 1 -w 1000 192.1 >nul & goto :lock
- goto :eof
-
- goto :eof
- :mutexUnlock
- del "%temp%\abc.lock"
- goto :eof
复制代码
|