Ian Lewis 11/7/2007

Setting output of a program to a variable in Windows Batch

Read Original

This technical article explains how to set the output of a program or command to a variable in Windows Batch scripting, avoiding temporary files. It details the use of the FOR /F loop with tokens and delimiters to parse output, using the example of converting a Cygwin path to a Windows path with cygpath for integration with TortoiseMerge and Mercurial.

Setting output of a program to a variable in Windows Batch

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

1
The Beautiful Web
Jens Oliver Meiert 2 votes
3
LLM Use in the Python Source Code
Miguel Grinberg 1 votes
4
Wagon’s algorithm in Python
John D. Cook 1 votes