recentpopularlog in

kme : cmd.exe   16

windows - How do I use a pipe to redirect the output of one command to the input of another? - Stack Overflow
So it looks like you can't pipe the output of batch files into other programs with CMD.EXE, which I just... never noticed.

Workaround is to use PowerShell to run the whole pipeline, since it has proper pipes
You can also run exactly same command at Cmd.exe command-line using PowerShell. I'd go with this approach for simplicity...
<code class="language-powershell">PowerShell -Command "temperature | prismcom.exe usb"</code>

Please read up on Understanding the Windows PowerShell Pipeline

You can also type in C:\>PowerShell at the command-line and it'll put you in PS C:\> mode instanctly, where you can directly start writing PS.
windows  cli  cmd.exe  cmd  shellscripting  powershell  workaround  sortof  solution 
august 2019 by kme
Shift - reposition command line parameters |
The parameter %0 will initially refer to the path that was used to execute the batch - this could be MyBatch.cmd if in the current directory or a full path like C:appsmyBatch.cmd

If SHIFT is used to move a text parameter into %0 then any references to %0 will refer instead to the current working directory, unless the new parameter value happens to contain a valid path.

For example:
%0..MyExecutable.exe will run MyExecutable from the same directory as the Batch file.

If the following parameter is passed to myBatch.cmd

myBatch.cmd D:utils

Then the following commands in myBatch will run MyExecutable.exe from the directory D:utils

windows  scripting  batchprogramming  cmd.exe  dammitbrain  essential 
october 2012 by kme

Copy this bookmark:

to read