Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Using Unix shell's backquote functionality in DOS/Windows batch files (See related posts)

In BAT files, an equivalent of a Unix shell's
set foo `bar`


can be accomplished as

bar>bar.tmp
set /p foo=<bar.tmp


If you're spoiled by Unix's notion of
true pipes, note that the following:

bar | set /p foo=


does not work.

You need to create an account or log in to post comments to this site.


Click here to browse all 5147 code snippets

Related Posts