I have a python script which gives the output as: The lastest filename of a directory.
I want to use this filename in a batch script. How can i able to do it?
I have a python script which gives the output as: The lastest filename of a directory.
I want to use this filename in a batch script. How can i able to do it?
You can get the output of a command with a for /f
loop:
for /f "delims=" %%a in ('command') do set "var=%%a"
replace command
with your phyton script.
Note: as written, the variable will contain the last line (or only one) of the output.
Note: this is batch file syntax. If you use it directly on command line, replace every %%a
with %a