Delete the extra space from echo command with a pipe
<p>i have a simple problem that i can't manage to solve...</p>

<p>i use this line of batch to print the result of a command in a file without the carriage return : </p>

<pre><code>echo | set /P=%tmp% &gt; %~n1.txt
</code></pre>

<p>but it keeps adding an extra space at the end that i don't want...</p>

<p>i've read some other posts but it is my first batch program so i'm a little lost with there solutions :p</p>

<p>i've tried :</p>

<pre><code>%^^^cmd | set /P=%tmp% &gt; %~n1.txt
</code></pre>

<p>Any ideas  ?</p>

<p>Thanks !</p>