To do what Jesse describes, from a Windows batch file you will need to write:
for /f "delims=" %%a in ('ver') do @set foobar=%%a
But, I instead suggest using Cygwin on your Windows system if you are used to Unix-type scripting.
More Related Contents:
- Variables are not behaving as expected
- Single line with multiple commands using Windows batch file
- How can I echo a newline in a batch file?
- ‘Pretty print’ windows %PATH% variable – how to split on ‘;’ in CMD shell
- Where is “START” searching for executables?
- Find out if file is older than 4 hours in Batch file
- Can Windows’ built-in ZIP compression be scripted?
- How to code a BAT file to always run as admin mode?
- How to verify if a file exists in a batch file?
- Windows command to convert Unix line endings?
- Stop and Start a service via batch or cmd file?
- Show a popup/message box from a Windows batch file
- Batch file variables initialized in a for loop
- How do I echo and send console output to a file in a bat script?
- Set a persistent environment variable from cmd.exe
- Copy text from a Windows CMD window to clipboard
- File redirection in Windows and %errorlevel%
- What does symbol ^ mean in Batch script?
- How to run a PowerShell script within a Windows batch file
- Resolve absolute path from relative path and/or file name
- cmd is somehow writing Chinese text as output
- How to count no of lines in text file and store the value into a variable using batch script?
- How to test if a path is a file or directory in Windows batch file?
- Rename multiple files in cmd
- Split string with string as delimiter
- How to change Screen buffer size in Windows Command Prompt from batch script
- Delete all files and folders in a directory
- Remove trailing spaces from a file using Windows batch?
- Using echo y as an automated response to a pcp hostkey prompt
- Batch file to upload .txt to FTP