Reputation: 8943
I have the output of a file that I would like to make a varabile in a batch program. How do I go about doing this? I would like to take the output of this, php file.php
and put it into a variable named %this%
. How do I do that?
[edit] Removed tags, this question is meant to provide an example for batch variable handling only. The fact that I used PHP was just an example, it could just as well be a python file that I'm reading the output from, or a regular executable.
Upvotes: 2
Views: 966
Reputation: 2769
@ECHO OFF
php file.php > output.txt
set /p OUTPUT= < output.txt
del output.txt
echo %OUTPUT%
Upvotes: 5