error: health) was unexpected at this time.

20 pts.
Tags:
Microsoft Windows 2000
Script errors
Windows 2000 Server
Windows Batch Files
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

The script is now running; I replaced %f with %%f

D:\health\Health_Check_Windows.exe
del D:\health\output.txt
for %%f in (D:\health\*.txt) do (echo %%f >> D:\health\output.txt & type %%f >> D:\health\output.txt)
C:\Windows\System32\blat.exe D:\health\output.txt -subject “Health_check_Report” -to<email id>

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    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,
    69,240 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following