系统找不到指定的路径 [英] System cannot find the path specified

查看:131
本文介绍了系统找不到指定的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我执行批处理文件并将输出写入文本文件时,在命令提示符下收到错误消息系统找不到指定的路径".我必须在我的批处理脚本中找到哪一行,抛出此错误或找不到的路径.

When I execute my batch file and write the output to a text file, I am getting error message "system cannot find the path specified" in the command prompt. I have to find which line in my batch script, throws this error or the path which is not found.

注意:由于我的脚本中有很多行,所以我无法遍历每行并检查路径.

Note: As I have so many lines in my script, I cannot go through each line and check for the path.

在出现此错误时,我必须获取导致此错误的路径或行.

I have to get the path or the line which causes this error when this error comes.

推荐答案

调试此类错误的最快方法是

The quickest way to debug an error like this would be to

  • 如果脚本顶部有@echo off,请删除
  • 删除任何用于命令的>nul或类似内容
  • 在脚本的最后添加pause
  • Remove @echo off if you have that at the top of your script
  • Remove any >nul's or similar you have for any commands
  • Add a pause at the very end of the script

现在运行脚本并查看每个命令的输出,直到找到错误为止,然后您可以查看该命令是针对哪个命令执行的.

Now run the script and look at the output for each of the commands until you find the error, and then you can see which command it did it for.

这篇关于系统找不到指定的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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