Automation tails from the fox hole

Capture command line output with MDT Toolkit

At a client, we needed the ability to run a command on the end user’s computer and then redirect the output to the BDD/SMSTS log. In this particular case, the issue was because the USMT Scanstate tool would choke on any files with Alternate Data Streams. If you’re curious, ADS is a method of storing two or more ‘streams’ of data on the disk pertaining to a file. This is not found very often, and typically only during issues like this one. In our case, files that had been downloaded from the internet with IE and never executed would be in a state in which the file was blocked, and to unblock it one would have to right-click the file and then choose unblock.

We used this tool created by Mark Russinovich of System Internals to automate the unblocking of files, to allow the process to complete. You can use the same script to redirect any of your own tools to the logs. If you’re just interested in creating your own log entries, you can place the following lines into your own scripts.