20 pts.
 error: health) was unexpected at this time.
I run a script which send a set of text files to email ids. When I run each line of the script separately on the cmd, email sending is successful. But when I place all the lines in a script say script.bat and run the script , I am getting the error   :  [strong]health) was unexpected at this time.[/strong]

The script is :

D:healthHealth_Check_Windows.exe del D:healthoutput.txt for %f in (D:health*.txt) do (echo %f >> D:healthoutput.txt & type %f >> D:healthoutput.txt) C:WindowsSystem32blat.exe D:healthoutput.txt -subject "Health_check_Report" -to <emailid>



Software/Hardware used:
windows 2000
ASKED: April 22, 2010  12:26 PM
UPDATED: April 22, 2010  2:30 PM

Answer Wiki:
Hi, The script is now running; I replaced %f with %%f D:healthHealth_Check_Windows.exe del D:healthoutput.txt for %%f in (D:health*.txt) do (echo %%f >> D:healthoutput.txt & type %%f >> D:healthoutput.txt) C:WindowsSystem32blat.exe D:healthoutput.txt -subject "Health_check_Report" -to<email id>
Last Wiki Answer Submitted:  April 22, 2010  2:30 pm  by  BatchScripts   20 pts.
All Answer Wiki Contributors:  BatchScripts   20 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Could you please post your script again using the editor’s ‘code’ tool ?
Also, write each backslash twice, because it is an escape character here, and please let us know what is the line of code causing the error, as ‘health’ appears many times in your script.

Thanks,

 63,580 pts.