top of page
Search
Writer's pictureJose Rodriguez

Saturday Morning Batch Lab



So what did I wanna do?

OK, what I wanted to do was create a batch file that can create a report based on information I can get from the CMD prompt. These are some of the things that i wanted to know.

I wanted to get Mac address details.

I also wanted to get interface names and status.

I wanted to get a routing table for the system's network.

Other nice to haves would have been getting statistics to know how long a system has been left on.

I also would like to know how many user accounts are on the PC (for security purposes).


A lot of the commands that I used work well in the CMD terminal but did not work well in a batch file initially.

I had to go through six different versions of the batch file before I could get it to create at least three reports for me. One would generate a Mac address report, another would also give me Interface names and status along with a routing table. The other things I wanted will have to wait for some other time.


I wanted this batch file to do a number of things. In order, I wanted it to create a directory in the C drive and title it "surveillance". After that I wanted it to run certain commands the first one was the getmac command so that we could generate a Mac address report. Next in order for me to get the interface names and status I had to use a net SH interface show interface command and that worked pretty well. After that I used a route print to create that routing table report. and that's pretty much the bulk of it right there. Each one of these individual reports was put in the surveillance folder. Along with these reports a new report file was created titled "surveillanceReport" all other reports within the folder were appended into it. In total it took me about 3 hours to create. My goal for creating this file is to help me diagnose my network and spot any intrusions. Hopefully it will improve my workflow at work and at home.


Resources used to create my little project were easily accessible information from these sites.




5 views0 comments

Comentários


bottom of page