0

This .bat file works fine until the 3rd line. The command on the 4th line takes a while to execute but when it's done the rest of the lines don't run

cd 09
cd png
FOR %%G IN (*.*) DO npx @squoosh/cli --oxipng {quality:75} "%%G"
cd ..
cd jpg
FOR %%G IN (*.*) DO npx @squoosh/cli --mozjpeg {quality:75} "%%G"
cd ..
cd ..
aschipfl
  • 33,626
  • 12
  • 54
  • 99
Charles Stangor
  • 292
  • 7
  • 21
  • 3
    The fourth line is `cd ..`. The only reason that could possibly take a long time to run is if your hard drive is dying. Did you mean the first `for` loop with the `npx` command? If nothing is running after that, I suspect that `npx` is also a batch script and you'll need to use `call npx @squoosh/cli --oxipng {quality:75} "%%G"` instead so that the script can continue once the commands are done. – SomethingDark Jan 21 '22 at 18:11
  • 1
    @SomethingDark you are correct. I just downloaded the installer and `npx` is a batch file. – Squashman Jan 21 '22 at 18:17
  • 1
    npx is part of the npm package. So this Q&A should apply. https://stackoverflow.com/questions/42305275/creating-a-bat-file-with-npm-install-command – Squashman Jan 21 '22 at 18:20
  • ty everyone. so helpful. – Charles Stangor Jan 21 '22 at 22:05

0 Answers0