humbletech99 Posted November 9, 2007 Report Share Posted November 9, 2007 I am writing a batch file and need to store the output of a command in a variable. I have been going round and round trying to do his properly but not getting very far.Does anyone know how to store and output of a command in a variable in Batch files? Quote Link to comment Share on other sites More sharing options...
Scarecrow Man Posted November 9, 2007 Report Share Posted November 9, 2007 You could output it to a file and read that file.just run command > fileFor example:ipconfig > C:\ipconfig.txtThis will create a file called ipconfig.txt on your C drive with the information outputted by the command ipconfig. Quote Link to comment Share on other sites More sharing options...
humbletech99 Posted November 9, 2007 Author Report Share Posted November 9, 2007 no that is far too basic. 1. I don't want to use temp files for many reasons. 2. I want to catch the output within the script for further script use and this is better done by assigning the output to a var. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.