Automating Native Commands

by May 14, 2010

You’ll discover that some native commands require interactive keystrokes before they work. For example, to format a drive, for security reasons you need to enter the current volume name and then hit “Y.” To automate these commands, you should put the input onto the pipeline in the order the command expects the information to be typed in, and then feed it to the command:

“Volume”, “Y” | Format i: /FS:NTFS /Q

Twitter This Tip! ReTweet this Tip!