Assuming that the fciv.exe
file has been placed in the system directory C:\WINDOWS\system32
, it works correctly both when it is recalled from command prompt and when it is used in Batch scripting files. For instance:
@echo off
fciv -md5 C:\DOCUME~1\myUsername
pause
The above statements work well.
But, if I use fciv
inside a for
cycle, as in the following example:
@echo off
for /f "tokens=1 delims=/ " %%g in ('fciv -md5 C:\DOCUME~1\myUsername') do (echo %%g)
The command is not recognized and an error returns from command prompt:
"fciv" is not recognized as internal or external command, etc.
The same statement works in command prompt - of course using a %g
variable.
In order to be correctly interpreted as a command in for
cycles inside Batch files, I am forced to use a full path to fciv.exe
file.
Is anyone able to explain me why this happens?