Hi Folks,
I'm a Unix guy - where I could do this in two seconds. Windows makes everything difficult - LOL.
Having some trouble with Windows BAT.
I just want a counter setup so I know how many texture files my script has left to process while running. It's converting files to DDS using the NVidia Legacy DDS Toolset. It takes a considerable amount of time to process a large number of textures (especially with compression) - so I want some progress info while running.
So before I start my loop processing of the textures (which works fine) - I just want to count the "BMP" files in a given directory and set a variable with the result - that I can decrease by (1) on every cycle of my DDS loop. The "dir" command gives me the correct output - it's just assigning that output to a variable that seems to be the issue.
What am I doing wrong? Trying to follow examples found on the net. Is there a better way to simply count the BMP files in a given directory?
Thanks.
Regards,
Scott
I'm a Unix guy - where I could do this in two seconds. Windows makes everything difficult - LOL.
Having some trouble with Windows BAT.
I just want a counter setup so I know how many texture files my script has left to process while running. It's converting files to DDS using the NVidia Legacy DDS Toolset. It takes a considerable amount of time to process a large number of textures (especially with compression) - so I want some progress info while running.
So before I start my loop processing of the textures (which works fine) - I just want to count the "BMP" files in a given directory and set a variable with the result - that I can decrease by (1) on every cycle of my DDS loop. The "dir" command gives me the correct output - it's just assigning that output to a variable that seems to be the issue.
What am I doing wrong? Trying to follow examples found on the net. Is there a better way to simply count the BMP files in a given directory?
Code:
@echo off REM Set Paths set "terrtex=E:\MSTSmini\CT River\Train Simulator\Routes\ConnRiv\TERRTEX" set "ImgTool="Y:\NVIDIA Corporation\DDS Utilities\nvdxt.exe"" REM Count Files FOR %%i IN ('dir /b /s /A-d "%terrtex%\*.bmp" | find "" /v /n /c') do set RESULT=%%i echo The directory is %RESULT% REM Make DDS cd /D "%terrtex%" FOR %%i IN (*.bmp) DO (%ImgTool% -box -dxt1c -outdir "%terrtex%" -file "%%i" echo "%%i") echo. echo. echo Run Complete...
Regards,
Scott
Comment