不断获取该命令的语法不正确 [英] Keep getting The syntax of the command is incorrect

查看:62
本文介绍了不断获取该命令的语法不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,尝试运行此批处理文件时出现问题

Hello im having a bit of problem when trying to run this batch file

@echo off

rem ashton scotland

rem test file

cls

if exist C:\Users\ashton\Desktop\test\

echo the directory exists

有人可以指导我为什么我收到该错误消息谢谢

can someone please guide me as to why im getting that error message thanks

推荐答案

if条件后没有命令.尝试此操作:

there is no command after if condition.Try this:

@echo off

rem ashton scotland

rem test file

cls

if exist "C:\Users\ashton\Desktop\test\" (

 echo the directory exists
)

@echo off

rem ashton scotland

rem test file

cls

if exist "C:\Users\ashton\Desktop\test\"  echo the directory exists

这篇关于不断获取该命令的语法不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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