Yes, you can create a script which reads the output of shelled commands (commands executed in a so called 'DOS box'). You could use some command line redirection 'tricks' or you could Windows APIs to do the job (better, more robust way). But that wont be easy to understand if you're not an experienced scripter though.
For example, to shut down your computer, instead of executing an external program (which you're not certain it will exist on the system, plus it is limited in what it can do), you can call the Windows API
ExitWindowsEx, or
InitiateSystemShutdownEx, etc. The possible Windows APIs to be used are listed
here.
Also, in many cases, when people ask for something like that (how to read the ouput of external commands), there are many times better solutions which do not involve running a 'DOS box'. You better avoid 'DOS boxes' if you can.
So, what are you attempting to do or what is the reason behind asking that question?