After reviewing the definition of a Batch file redirection commend, I experimented a bit, and came up with this code:
:: CMD will no longer show us what command it’s executing (cleaner display)
ECHO Batch File Executing
:: Print some text to cue the user
:: Marjories mapping to .NET Framework version 4
:: Compile Visual Basic code [from .vb to .exe]
GoodLuck > GoodLuckOutput.txt
:: Outputs information into a text file
:: Lets the user prepare before closing command prompt
I discovered that I really misunderstood what a .BAT file is, as well as what it can and cannot do.
I was just going through the Spring 2013, ITS 121 networking text book and noticed there is a good section on creating script files. After reading it, I realized two things looking back, Chapter 9 was a blur and that my old sysadmin script libraries were really a complex collection of batch files. I know we flew through Chapter 9 and 10 pretty quickly focusing mainly on using file structure commands, EDIT and VIM, especially since we were running out of semester already.
My understanding now is that my old admin scripts simply called each other based on various conditions, conditional environment variables used in IF-THENs, and the execution of various sysadmin level commands like mstsc or tcpview. Another thing I learned is that where the Windows command line’s power and awesomeness stops, Windows Powershell begins. Specifically, the manipulation of not just .TXT and .CSV files, but objects. I find this really huge when sorting lots of data, and you do not have access to Access nor a SQL server.
Just my two cents, anyone in the ITS 215 would benefit quite a bit reviewing Chapters 9 and 11. Someday they may get tired of the point-and-click, GUI world and desire a custom automated solution, especially if you’re a Linux fanboy.
Have a great weekend.