如果存在问题的命令 [英] If Exists command problems

查看:115
本文介绍了如果存在问题的命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建的是应该进入一个文件夹,检查文件是否存在一个批处理文件,如果存在的话,它需要的文件复制到另一个目录。问题是每一次我尝试和运行批处理文件出现错误时间:


  

的text.txt是意外,此时


目前我正在与此类似code:(修订版)

 如果存在的text.txt(复制的text.txtC:\\目录\\ copiedFile)


解决方案

我认为你正在使用的语法是有点过。

如果不存在的text.txt(副本的text.txt C:\\目录\\ text_copy.txt)

I created a batch file that is supposed to go into a folder to check to see if a file exists, and if it exists, it needs to copy that file to another directory. The problem is every time I try and run the batch file I get the error:

"text.txt" was unexpected at this time

and currently I am running code similar to this: (UPDATED)

if exist "text.txt" (copy "text.txt" C:\directory\copiedFile)

解决方案

I think the syntax you are using is a bit off.

IF EXIST text.txt (copy text.txt C:\directory\text_copy.txt)

这篇关于如果存在问题的命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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