---
title: "批处理结束后关闭DOS窗口"
author: "Freeze"
date: "2009-08-05T10:05:17Z"
tags: []
slug: "dos"
draft: false
lastmod: "2009-08-05T10:06:57Z"
id: 440458
url: "https://freeze.iteye.com/blog/440458"
---

在前面加上start就可以。

不然要关闭打开的窗口，DOS才会关闭。


```java

:: 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
)
)

```