DOS如何批处理?文件如何判断是否存在?

如题所述

前期准备:假如在D盘根目录下建立一个.bat文件,再建立一个名字为"file.txt"的文本文档.然后判断D盘根目录下是否有a.mp3和b.mp3以及c.mp3这些文件.程序如下:\x0d\x0a@echo off\x0d\x0aif exist D:\a.mp3 echo a.mp3>>file.txt\x0d\x0a if not exist D:\a.mp3 echo a.mp3不存在>>file.txt\x0d\x0aif exist D:\b.mp3 echo b.mp3>>file.txt\x0d\x0a if not exist D:\b.mp3 echo b.mp3不存在>>file.txt\x0d\x0aif exist D:\c.mp3 echo c.mp3>>file.txt\x0d\x0a if not exist D:\c.mp3 echo c.mp3不存在>>file.txt
温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网