3

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.

Ramya
  • 121
  • 2
  • 7
  • 13

2 Answers2

8

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

  • 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.

Bali C
  • 30,582
  • 35
  • 123
  • 152
0

Look the first place in your batch that requires the path, i.e., a call like "copy" or "del", create a new line after it and put exit. Repeat further down the batch file until the problem appears.

akTed
  • 214
  • 2
  • 8
  • 1
    That can be done, but Is that possible to print the path which it cannot find, when that error comes? – Ramya Jan 07 '13 at 05:27