Script to convert BMP to JPG, Need help completing.
Posted: 2019-02-25T08:11:37-07:00
Windows 10 system, using cmd
I have a NAS full of images, buried deep in a series of subfolders. I am trying to write a script to reduce all images older than 90days from BMP to jpg.
What I have so far,
forfiles /P [dir1\dir2\....] /S /M *.bmp /D -90 /C "cmd /c magick morgify @fname -format jpg *.bmp"
When i run this command, it does process the BMP to JPG as needed, but it then tries to run again and again creating ~jpg files and errors in cmd line i assume bc the jpg file names exist.
What I also need is a way to remove the original BMP file, my NAS is 0.06% empty and can't afford to create double pictures
I have a NAS full of images, buried deep in a series of subfolders. I am trying to write a script to reduce all images older than 90days from BMP to jpg.
What I have so far,
forfiles /P [dir1\dir2\....] /S /M *.bmp /D -90 /C "cmd /c magick morgify @fname -format jpg *.bmp"
When i run this command, it does process the BMP to JPG as needed, but it then tries to run again and again creating ~jpg files and errors in cmd line i assume bc the jpg file names exist.
What I also need is a way to remove the original BMP file, my NAS is 0.06% empty and can't afford to create double pictures