Hi guys,
Is there something wrong with my set statement? I'm getting "The system cannot find the file specified."
But dir /a /s /OG D:\FYP\piclog |find /v "<DIR>" | find /c "M" alone returns a proper integer value, 21 etc.
set /A count="dir /a /s /OG D:\FYP\piclog |find /v "<DIR>" | find /c "M""
echo.%count%
Problem with set /A
Moderator: DosItHelp
Re: Problem with set /A
Use a FOR /F loop to receive a value from a command line:
Regards
aGerman
Code: Select all
for /f %%i in ('dir /a /s /OG D:\FYP\piclog |find /v "<DIR>" ^| find /c "M"') do set /a count=%%i
Regards
aGerman
Re: Problem with set /A
Thanks! but my command prompt window closes right after it runs, even with a pause at the end. Any idea what is wrong?
EDIT: It says | was unexpected at this time.
EDIT: It says | was unexpected at this time.
Re: Problem with set /A
Missing a Carrot before the first pipe.
Re: Problem with set /A
done! sorry i'm new at this, you guys are great