![]() Set convert_exe=C:\Program Files\ImageMagick-6.8.0-Q16\convert.exe I can see that it is quoting the path name "C:\test 1\" but still not finding the files if a space is in the path.Īny suggestions on how to correct this without having to take the spaces out of my folder names? JPG files not found in folder "C:\test 1\". The system cannot find the file specified.Įcho JPG files not found in folder "C:\test 1\". **echo Found 1 JPG files in folder C:\test\.īut when I rename the folder to test 1 I get: **IF (0) EQU (0) (call set foldername=%~dp1 for /F "usebackq delims=" %i in (`dir /a:-d /b %foldername%\*.jpg`) do set /a dirCnt =1)Įcho JPG files not found in folder "C:\test\". **for /F "usebackq delims=" %i in (`dir /a:-d /b C:\test\PP0306_DigiTool_image1.jpg\*.jpg`) do set /a dirCnt =1 **(set foldername=C:\test\PP0306_DigiTool_image1.jpg ) On a 64 bit Win7 machine with a folder called c:\test I get this as the result (echo on, some items removed for brevity): The code works great except when there is a space in the folder name. IF EXIST "%foldername%\%resizeSize%\%%i" (Įcho Deleting source file: '%foldername%\%%i'.Įcho Unknown error is occurred! Aborting.Įcho Resizing is done, check folder %resizeSize% for results! IF (%tmpCnt%) EQU (0) md %foldername%\%resizeSize%Įcho Error! Can't create folder "%foldername%\%resizeSize%".Įcho Resizing JPG files in "%foldername%":įor /F "usebackq delims=" %%i in (`dir /a:-d /b %foldername%\*.jpg`) do (Ĭall echo Proceed file %%tmpCnt%% from %%dirCnt%%: %%i.Ĭall cmd /c "TYPE "%%foldername%%\%%i" | "%convert_exe%" jpg:fd:0 -filter lagrange -set option:filter:support 2.0 -set option:filter:win-support 12 -set option:filter:lobes 8 -resize %%resizeSize%% -bordercolor white -border 8 -bordercolor grey60 -border 1 "%%foldername%%\%%resizeSize%%\%%i"" You need to remove this file from folder.įor /F "usebackq delims=" %%i in (`dir /B /A:D %foldername%`) do ( Exiting.Įcho Found %dirCnt% JPG files in folder %foldername%.įOR /F "usebackq delims=" %%i in (`dir /B /A:-D %foldername%`) do (Įcho Found file with name "%resizeSize%". You need to set it up in batch file!įor /F "usebackq delims=" %%i in (`dir /a:-d /b %foldername%\*.jpg`) do set /a dirCnt =1įor /F "usebackq delims=" %%i in (`dir /a:-d /b %%foldername%%\*.jpg`) do set /a dirCnt =1Įcho JPG files not found in folder "%foldername%". Set convert_exe=C:\Program Files\ImageMagick-6.6.2-Q16\convert.exeĮcho ImageMagick path is incorrect.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |