Computing.Net > Forums > Programming > Batch file to run program

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch file to run program

Reply to Message Icon

Name: bismarkcount
Date: June 4, 2007 at 14:07:56 Pacific
OS: windows xp
CPU/Ram: 1gb
Product: dell
Comment:

Hej!

i am new at dos batch files, so i need your help to notice what i am doing wrong.

I have built a .NET program called JLMail which can send mail from command line, so i can execute from cmd prompt by typing:

JLMail from@mail, to@mail, Subject, message, cc@mail.com, att1

so i am using a batch file to execute and send mail to all the people in my mailing list (Mailinglist.txt), here is the code:

::@echo off
FOR /f %%X IN (Mailinglist.txt) DO (
SET mailstring ="JLMail noreply@JLMail.com,"%%X",Subject,message,cc@mail.com,attachment.xls"
ECHO %mailstring%
)


I want to print my resulting string to screen so that i could see if the string is well formed and ready to execute, but just cant get it.

could you please help me to see what went wrong?



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: June 4, 2007 at 14:22:43 Pacific
Reply:

So what DOES it echo?


=====================================
If at first you don't succeed, you're about average.

M2



0

Response Number 2
Name: bismarkcount
Date: June 4, 2007 at 14:27:21 Pacific
Reply:

i just want it to echo the string that i am going to execute, so i can know if the string is properly formed.

the output of the echo should be:

JLMail.com from@mail.com,to@mail.com,Subject, message,cc@mail.com,attachment.xls

and this whole string is the one that will use the JLMail application to send the mail.

The problem is that when i am echoing mailstring it gives me 0.

thnx a lot M2


0

Response Number 3
Name: Razor2.3
Date: June 4, 2007 at 16:37:20 Pacific
Reply:

FOR /f %%X IN (Mailinglist.txt) DO @ECHO JLMail noreply@JLMail.com,"%%X",Subject,message,cc@mail.com,attachment.xls


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch file to run program

Batch File To temporarily backup www.computing.net/answers/programming/batch-file-to-temporarily-backup-/9826.html

Batch File to Delete Files Older Than 1 Day www.computing.net/answers/programming/batch-file-to-delete-files-older-than-1-day/18765.html

Batch file not run scheduled task www.computing.net/answers/programming/batch-file-not-run-scheduled-task/16757.html