Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First you should test, if the <code>gnokii.exe</code> accepts multiline texts via a pipe.<br> Simply create a multiline text file and try it with</p> <pre><code>type mySMS.txt | c:\sms\gnokii.exe --sendsms 0771234567 </code></pre> <p>If this works it should be also possible to send it from a batch file and add linefeeds into the text.</p> <pre><code>@echo off setlocal EnableDelayedExpansion set LF=^ rem ** The two empty lines are required ** echo Begin Transaction echo Line1!LF!Line2 | c:\sms\gnokii.exe --sendsms 0771234567 'this is mobile no </code></pre> <p>EnableDelayedExpansion should be used when linefeed characters are used.<br> There exists also solutions to use it with percent expansion, but that is much more complicated.<br> <a href="https://stackoverflow.com/a/6379861/463115">Explain how dos-batch newline variable hack works</a></p> <p>To use this with parameters like in your comment, you need to format the message in VB.</p> <p>So when you want to send a text like</p> <blockquote> <p>Hello<br> this is a text<br> with three lines </p> </blockquote> <p>You need to send to the batch </p> <pre><code>process.StartInfo.Arguments = "Hello!LF!this is a text!LF!with three lines" </code></pre> <p>And your batch should look like</p> <pre><code>setlocal EnableDelayedExpansion set LF=^ set "text=%~1" echo !text! | c:\sms\gnokii.exe --sendsms %2 </code></pre> <p><strong>A second solution, when this doesn't work.</strong></p> <p>Create a temporary file and use redirection</p> <pre><code>setlocal EnableDelayedExpansion set LF=^ set "text=%~1" echo !text! &gt; "%TMP%\sms.txt" c:\sms\gnokii.exe --sendsms %2 &lt; "%TMP%\sms.txt" del "%TMP%\sms.txt" </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload