Archive for December, 2008

Batch Set Var From Application Output

I have been looking for this line of code for a while. I needed to set a var in a batch script to be the output from an application.

FOR /F "tokens=*" %%R IN ('PROGRAM.EXE /SWITCH') DO SET VAR=%%R

My first attempt was something like this

application > ~tmpFile
set /p var= < ~tmpFile del ~tmpFile

This post is a prequel to simple mysql backup script for windows.

Tags:

Thursday, December 11th, 2008 Programing Comments Off on Batch Set Var From Application Output