Saved Bookmarks
| 1. |
Solve : get result of std out and set to env var? |
|
Answer» HEY all, I am trying to write a bat file that gets the output of an exe that would normally print its data to the screen and use the result to SET an env variable. This is the example C:\progs\readReg.exe THIS_VAR would result in C:\thisVAR but what i want is basically this set ENV_THISVAR=C:\progs\readReg.exe THIS_VAR . obviously, ENV_THISVAR gets set to C:\progs\readReg.exe THIS_VAR Please help, Thanks, JasonI'm not really clear on what you're asking. As FAR as I know a batch file stores it's own name (%0) and it's parameters (%1-%9) but it's the command processor that keeps track of any executables that the batch file actually runs. A VBScript can be constructed to capture and process a program's output, but of course the information you're looking for would have to be included in that data. More info on the output of readReg.exe might be helpful. Let US know. 8-)Jason, This is what you want: Code: [Select]for /f "tokens=*" %%a in ('"C:\progs\readReg.exe THIS_VAR"') do set ENV_THISVAR=%%a echo.%ENV_THISVAR% Right? THATS exactly what i was looking for. Thanks a ton DosItHelp! |
|