批处理结束后关闭DOS窗口

在前面加上start就可以。

不然要关闭打开的窗口,DOS才会关闭。


:: Freeze 2009-08-05 Eimage.com
@echo off
if "%1" == "" (
set mydate=%date:~0,4%%date:~5,2%%date:~8,2%
if exist "D:\今日工作\%mydate%.txt" (
start notepad.exe D:\今日工作\%mydate%.txt
) else (
::echo.>D:\今日工作\%mydate%.txt
echo.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>D:\今日工作\%mydate%.txt
echo.%date:~0,4%%date:~5,2%%date:~8,2% [√] [×]>>D:\今日工作\%mydate%.txt
start notepad.exe D:\今日工作\%mydate%.txt
)
) else (if exist "D:\今日工作\%1.txt" (
start notepad D:\今日工作\%1.txt
) else (
note
)
)

你可能感兴趣的:(IT)