BAT files that I use in my Windows environments, to make life easier
#### ![icon credit: dave-gandy](http://cdn.flaticon.com/png/24/4426.png) [backup_dump.bat : backup a database in a password protected zip file] (https://github.com/paulera/bat-scripts/blob/master/backup_dump.bat) I made this script as a quick way to get snapshots of my local databases. It uses the mysqldump command to generate a database dump and compress it as a mpassword protected zip file.
Depending on the project size, when commiting code, I commit a database snapshot generated by this script together.
#### ![icon credit: dave-gandy](http://cdn.flaticon.com/png/32/36024.png) [cdd.bat] (https://github.com/paulera/bat-scripts/blob/master/cdd.bat) and [cd-.bat] (https://github.com/paulera/bat-scripts/blob/master/cd-.bat) Use *cdd* to change the current directory exactly the same as you do with native *cd* command. Then you use *cd* as many times you need. Finally, use *cd-* to go navigate back to the folder you were when called *cdd* for the last time.
A additional calls to cdd does not overwrite the previous one. You can do it many times you need, and then call cd- many times as well to navigate back. Isn't this lovely?
#### ![icon credit: Icons8](http://cdn.flaticon.com/png/24/48339.png) [checkin.bat : appends the current date and time to a text file] (https://github.com/paulera/bat-scripts/blob/master/checkin.bat) I use this script to keep track of my arrival times at work (at least, the moment when my computer logged in, which is a good approach). Just place it in the _Startup folder_ (in Windows 7 it should be `*%USERPROFILE%*\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup`) and the data will be written in your home folder, in a file called __checkin.txt__.
#### ![icon credit: Icons8](http://cdn.flaticon.com/png/24/15563.png) [ektronsearchupgrade.bat : Runs the SearchUpgrade.exe tool for ektron sites] (https://github.com/paulera/bat-scripts/blob/master/ektronsearchupgrade.bat) The SearchUpgrade toll in Ektron is used to fix Search Results for PageBuilder Pages (https://portal.ektron.com/kb/1032/). Still want to improve it to get the values directly from the web.config file.
####![icon credit: designmodo](http://cdn.flaticon.com/png/32/25406.png)[hgchg.bat : list changes in a Mercurial repository] (https://github.com/paulera/bat-scripts/blob/master/hgchg.bat) Handy script if you work with the Mercurial version control system. You can run `hgchg /help` for usage instructions.
This script need a few additional executable files to work properly: sed.exe, sort.exe, uniq.exe and cut.exe. They can all be found in the unxutils project and their location must be added to the %PATH% environment variable in order to work from enywhere.
Syntax: hgchg [/me]
[/u <username> ...]
[ [/sd <start date>] [/fd <final date>] | [/rd <-X days>] ]
[/w <word> ...] [/wo <word> ...]
[/rev] [/age] [/c]
[/min] [/tab] [/clip] [/o <outputfile>]
[/help]
USERS
/u username | Show changes only for specific users./u can be used many times. ex: hgchg/u user1/u user2/u user3 |
/me or /1 | Show changes for the current logged user. |
FILTERS
/sd <start date> | Start date in the format YYYY-MM-DD. Current date is the default. |
/fd <final date> | Final date in the format YYYY-MM-DD. Current date is the default. |
/rd <-X> | Gets data from X days ago until today. Overrides/sd and/fd |
/date <YYYY-MM-DD> | Gets data from a specific date. Overrides/sd,/fd and/rd. |
/w <word> | Only results WITH the word./w can be used many times. |
/wo <word> | Only results WITHOUT the word./wo can be used many times. |
LIST STYLE
/rev or /r | Show revision number |
/age or /a | Show age, e.g. "10 hours ago", "2 weeks ago" |
/c | Show commit comments (first line only) |
/time | Show the time with the date |
/tab or /t | Tab mode - split columns using tabs, useful with/clip to use on excel |
/min or /m | Minimal mode (list unique files, sorted). Overrides/r and/a. |
/clip | Output the results to the clipboard instead of displaying them |
/o <file> | Output the results to the specified file. USE DOUBLE QUOTES or ESCAPE BACKSLASH (use c:\\file.txt instead of c:\file.txt) |
OTHERS
/help or /? | Display this help (using "/?" doesn't work) |
/v | Verbose |
/debug | Show debug messages. |
/rawdebug | Show debug messages and echoes every line executed in the script (ECHO ON) |
/check | Check dependencies and show instructions about how to properly install them. |
SEETTING UP THE PROJECTS LIST
Create a file HGCHG.CFG in the same place where the HGCHG.BAT is located, containing a list of the projects' root folders. Use # to comment lines. |
####![icon credit: Icons8](http://cdn.flaticon.com/png/24/48243.png) [pingog.bat : check internet connection] (https://github.com/paulera/bat-scripts/blob/master/pingog.bat) Ping the address www.google.com to check the internet connection (assuming that Google server never goes down).