I am trying to run this .bat script
set target_path =\\remoteserver\c$\newfolder\newfolder1\logs >log.txt
findstr /m "ERROR" "%target_path%\file1.txt" >> log.txt
The expected output from this .bat file is that it will pick up "ERROR" string from file1.txt from the "remoteserver" and will show as output in log.txt.
But,once when i run this script it shows me the following error
FINDSTR: Cannot open \remoteserver\c$\newfolder ...
Kindly, suggest me the flaws or correct script so that the above script gets executed successfully with the expected output .
thanks for your quick update and sorry for acknowledging late. I tried executing the batch script with the necessary corrections you mentioned needed in the script , but still i face the same problem . I am unable to fetch the "ERROR" from log file and get the expected output. Is there any other field to be added to "FINDSTR" to pull up the ERROR ??.. Kindly, assist me for the same. Thanx in advance.