与一批新建文件夹但只有当它不存在 [英] Create folder with batch but only if it doesn't already exist

查看:300
本文介绍了与一批新建文件夹但只有当它不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我该怎么做在Windows批处理脚本继? ( *蝙蝠

Can anybody tell me how to do the following in in a Windows batch script? (*.bat):


  • 创建一个文件夹,只有当它不存在

在更多的细节,我想创建一个名为 VTS 文件夹C:\\ 驱动器,但只如果该文件夹不存在。我不希望覆盖文件夹的内容,如果它已经存在,并执行批处理。

In more detail, I want to create a folder named VTS on the C:\ drive, but only if that folder doesn't already exist. I don't want to overwrite the contents of the folder if it already exists and the batch is executed.

推荐答案

您只需要使用这样的:,如果不存在C:\\ VTS的mkdir C:\\ VTS 它无线本地环路创建一个目录仅在文件夹不存在

You just use this: if not exist "C:\VTS" mkdir C:\VTS it wll create a directory only if the folder does not exist.

这篇关于与一批新建文件夹但只有当它不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆