Below is the .bat code I have for replacing the "/" occurrences of the first argument with "\", then executing that command with parameters %2, all redirected to %3:
@ECHO OFF
if exist %1 (
set a=%1:/=\%
%a% %2 > %3
) else (
Echo "File not found"
)
The output of the above is:
The system cannot find the path specified.
What is wrong with the above? Also, how could I split the second argument (%2) into words (given that it is a sentence, ie., a collection of words)?