M
M
mester2016-10-24 00:27:44
cmd/bat
mester, 2016-10-24 00:27:44

What is written incorrectly in the code of the .bat file (execution, file not found)?

I'm trying to make a .bat file that will execute the following command
start "" "D:\Web\Tools\IM convert\morgify.exe" "-format jpg" "-quality 90" *.png
At the same time, an error appears that such a file morgify.exe does not exist.
Tried many different methods described on the Internet - does not help.
If you first cd to the desired directory (in the .bat file), then dir - then the file exists.
However, an attempt to run it leads to an error that the file does not exist.
If you just write via cmd, everything works fine

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2016-10-24
@mester

Wang typo, try mogrify.exe instead of morgify.exe

M
Max, 2016-10-24
@MaxDukov

try to do

start "cd "D:\Web\Tools\IM convert\" &&  .\morgify.exe -format jpg -quality 90 *.png"

I think they messed up with quotes somewhere, because of this, a space in the directory name spoils everything.
only in this case it will look for all pngs in the converter directory.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question