[previous] | [main] | [next]

"batch-0-matic" by Flack

| Comments (2) | digg

batch-0-matic V1.0
Copyright (c) 2006, Flack/cDc-NSF
All Rights Reserved

01. What is batch-0-matic
02. System Requirements
03. Installation / Uninstallation
04. Interface / Usage
05. Examples
06. License Agreement
07. Bug Revisions
08. Contact Information
09. Suggested Additional Utilities

========================================

01. What is batch-0-matic

batch-0-matic (b0m) is a utility which allows users to input a list of variables into a batch file, giving users the ability to run the same batch file multiple times, replacing a variable each time. b0m is an invaluable tool for network administrators and is far more useful than it may at first glance, especially when used in conjunction with other command line utilities. For example b0m could add hundreds of users into a network group, stop a service across hundreds of servers in seconds, or run executables on multiple machines simultaneously, all with just a few clicks. The program is only limited by what users can perform from a simple Windows CLI.

In your batch files, %s is the variable that will be filled by the items in your collection list.

========================================

02. System Requirements

Windows 2000/XP/2003/?
VB6 Runtime Tools

========================================

03. Installation / Uninstallation

b0m does not need to be installed. Simply unzip the b0m zip file into a directory. Once unzipped you should see the executable (b0m) and four directories: collections, logs, scripts, and temp.

Collections: Your lists of servers / users / IP Addresses / whatever go in here. Files are in plain TXT format.
Logs: b0m logs every command executed. Those commands are logged here.
Scripts: Batch files that you commonly execute can be stored here. Files are in plain TXT format.
Temp: b0m generates batch files. Those files are temporarily stored in this folder. This folder is cleaned out every time the program launches and/or gracefully terminates. The directory can also be cleaned out by clicking Tools > Clean Up Temp Files.

NOTE: All b0m input files are plain TXT files and can be written with Notepad, DOS EDIT, or the plain ASCII editor of your choice. This makes b0m completely configurable to your needs.

========================================

04. Interface / Usage

[ Windows ]

Collections: These .TXT files are pulled from the COLLECTIONS folder. Clicking on a file in the Collections window should populate the window below it with the items from the collection. You can click a new collection at any given time.

Items in Collection: These are pulled from the Collection you chose. This window can also be edited manually, if you wish to add or remove a server manually from the Items list. Changes to this window are not saved to the source file.

Log Commands: Real time logs of your commands will be displayed here as they execute. This same data is written to a log file under the LOG folder.

Batch File / Scripting Window: This is where your batch file goes. You can type in this window directly, or you can select a file from the "Common Tasks" drop down bar directly above it. Remember, %s is the variable that will be replaced by the items in your collection list.

[ Options ]

Common Tasks: These are batch files stored in .TXT format under the SCRIPTS directory. If you wish to add/remove/modify a script, simply make the change in the scripts folder.

Spawn Mode: Spawn Mode is a very powerful and handy feature. b0m has the ability to run in two modes: standard mode and spawn mode. If for you created a one line batch file and have ten items in your collection, standard mode will create one batch file with ten lines in it, while spawn mode on the other hand will create TEN batch files that are ONE line long. This is VERY HANDY if you need to do something on a large amount of machines very quickly. Please note that Spawn Mode contains no error checking or memory management utility; if you try and launch 1,000 windows at the same time, b0m will try to do it. I have launched 400-500 batch files at a time before with success, but the ultimate results will depend on your machine's amount of RAM and processor speed.

Run Later: This will generate your batch file and save it in the root directory, where you can run it later manually if desired. Run later only works in standard mode, not spawn mode.

Start Delay (in seconds): For Spawn Mode, this will time your windows so that they do not all run at the same time. For example if you enter "60", your batch files will kick off one minute apart. Handy if you are rebooting servers and don't want to reboot your entire domain all at once!

[ Pull Down Menus ]

Tools / Refresh File List: If you add a new list and don't want to exit the program, this will update the Collections window.
Tools / Reload Selected File: If you edit a collection list and want to update the collection window, this does that.
Tools / Clean Up Temp Files: Never necessary to do manually, but I included it anyway.
About: Current version information and weblinks.

========================================

05. Examples

EXAMPLE ONE: Create a directory on five servers and copy files into that directory.

- Put all 5 servers in the server list, one per line (for this example: server_one, server_two, etc)
- In the Batch File window, type
md \\%s\c$\DIRECTORY_NAME
xcopy c:\filename \\%s\c$\DIRECTORY_NAME
- Click "LAUNCH BATCH-0-MATIC" to run your batch file.

The following batch file is created and run:

md \\server_one\c$\DIRECTORY_NAME
xcopy c:\filename \\server_one\c$\DIRECTORY_NAME
md \\server_two\c$\DIRECTORY_NAME
xcopy c:\filename \\server_two\c$\DIRECTORY_NAME
md \\server_three\c$\DIRECTORY_NAME
xcopy c:\filename \\server_three\c$\DIRECTORY_NAME
md \\server_four\c$\DIRECTORY_NAME
xcopy c:\filename \\server_four\c$\DIRECTORY_NAME
md \\server_five\c$\DIRECTORY_NAME
xcopy c:\filename \\server_five\c$\DIRECTORY_NAME

Note: Had you clicked "Spawn", it would have created five batch files instead and run them all at the same time.

EXAMPLE TWO: Stopping a service on 100 servers all at once.

(This requires SC.EXE from the Windows Resource Kit, not included with b0m)

- Open the collection that contains your 100 servers.
- In the Batch File window, type
SC \\%s stop SERVICE
- Check "Spawn Mode"
- Click "LAUNCH BATCH-0-MATIC" to run your batch files.

Note: 100 windows will open up and each one will stop the service on the corresponding server.

EXAMPLE THREE: Applying Microsoft Patch to 100 remote servers.

(This requires PSEXEC.EXE (freeware), not included with b0m)

- Open the collection that contains your 100 servers.
- Under batch file, use the following commands:
md \\%s\d$\patches
xcopy c:\patches\microsoft_patch.exe \\%s\d$\patches
psexec \\%s d:\patches\microsoft_patch.exe /quiet /forcerestart /forceappsclose
- Click "LAUNCH BATCH-0-MATIC" to run your batch file(s).

EXAMPLE FOUR: nbtstat an IP Range.

- Open the collection that contains your 100 servers (in this example, IP addresses)
- Under batch file, use the following commands:
echo %s >> c:\nbtstat_log.txt
nbtstat -a >> c:\nbtstat_log.txt
echo --------------------- >> c:\nbtstat_log.txt
- Click "LAUNCH BATCH-0-MATIC" to run your batch file(s).

The first line creates and then writes the server name to the nbtstat_log.txt file.
The second line performs nbtstat on the server and outputs the results to the log file
The third line writes "-------------------------" to the log file to separate the entries.

As you can see, b0m is only limited to whatever you can accomplish through a DOS batch file.

========================================

06. License Agreement

batch-0-matic is freeware. You may distribute b0m freely but must not sell it.

No warranty expressed or implied. I cannot imagine a way that b0m could harm your computer, other than through a batch file written by yourself.

========================================

07. Bug Revisions

V1.0 - First public release.

To Do List: ?

========================================

08. Contact Information

[ Author ]

Flack AT cdc-nsf DOT com

[ Web ]

http://www.ninjastrikeforce.com
http://www.cultdeadcow.com

========================================

09. Suggested Additional Utilities

Here are a few utilities that I use on a regular basis in conjunction with batch-o-matic. You can find zem wis ze Google.

psexec.exe: Run executables on remote machines.
psshutdown.exe: Shutdown/reboot remote machines.
sc.exe: Service Control: stop, start, and query services on remote machines.
renuser.exe - rename user accounts (handy for renaming administrator account on all servers)
cusrmgr.exe - change password of local accounts (change admin password)
netsh.exe - change remote TCP/IP settings (WINS, DNS, IPCONFIG, etc)
emptyrecyclebin.exe - dumps recycle bin on remote machine (use with PSEXEC)
reg.exe - add/remove/edit registry keys
setacl.exe - set permission on remote shares

I am sure you can think of other useful ones ...

- Flack

download batch-0-matic V1.0


Comments

brilliant.

I remember,I remember,
The house where I was born,
The little window where the sun
came peeping in at morn;
He never came a wink too soon,
Nor brought too long a day,
But now ,I often wish the night
had borne my breath away.


Post a comment

The comments to this entry are closed.

CULT OF THE DEAD COW

Mind viruses. Deadly memes.
ASSAULT TELECOM.
BOW TO THE COW

cDc site version 666.2.0

All of us in the cDc participate in this site. If you want to complain because this ain't teaching you how to be an 31337 hax0r, you can eat our collective ass. Thx!

Archives


RIP THE NIGHTSTALKER

THE NIGHTSTALKER
December 29, 1951 - June 14, 2012


Memesphere Poopfest

Has the cDc site inspired you to create your OWN? Has it filled you with a desire to go out and create a blog full of beauty and sparkly magic? Or has it driven you to create your own site full of bile, bitterness, and bad sportsmanship?

Click these buttons for red hott daisy chain action!

burn that fuggin' feed

cDc on archive.org cDc on delicious cDc on everything2.com cDc on Facebook
cDc Feed on Feedburner cDc on flickr cDc on Last.fm cDc on MySpace
cDc on Newgrounds cDc on Reddit cDc Technorati profile DSE on twitter
cDc on Wikipedia cDc on YouTube

Kitten Friendly!


Legal Crap

"CULT OF THE DEAD COW"
is a registered trademark of
cDc communications.
Use The Name, face The Wrath.

License | Privacy

Wiz Dumb

CULT OF THE DEAD COW

the internet's #1 white slavery and cockfighting site!
COW IS NOW

Recent texXxt

414 "How Are You Feeling?" by Oxycolton
413 "Temporary Paralysis: A One-Act Play" by Jake Edward Kara
412 "The Screen Generation" by elliot.pank
411 "The DEFCON 2007 Experience" by Oxycolton, KEMiKAL, and Flack
410 "My Bike" by Lupo



Recent Books

Invading Spaces


Recent Muzak


Recent grafx

cDc #047
cDc #047
"Sometimes it's just like that."
by Punkle Jones

cDc #046
cDc #046
"I Love a Parade!" by G. Ratte'

- all grafx -

Recent Video



- all video -