Wednesday, December 23, 2009

Buy Dr.Batcher with 40% discount on December 27

Mental Works Computing Software and Bits du Jour offer you special 40% discount for Dr.Batcher on December 27, 2009. Only that day you will be able to buy Dr.Batcher only for $17.97 and receive all benefits of the registered version of Dr.Batcher including:
* Unlimited time of use without nag-screens and other reminders
* All functions of the registered version
* Top-priority support
* Free minor updates (i.e. from version 2.0 to versions 2.1, 2.2, etc.)
* Money back guarantee within 30 days of the product purchase
Tell your friends and co-workers about this offer! Save your time and your money with the help of Dr.Batcher!
Details here:

Sunday, December 13, 2009

Creating Directories in Batch Files

Creating new directories using batch files is a common task for system administrators and even home users. But it's not so simple to create a directory with the proper name sometimes. For example, let's consider that we want to create a directory named using the current date and current time. How will you create it through a batch script? Probably you will type something like this:
md %date%%time:~0,2%%time:~3,2%
Now let's execute this code... What a surprise! We get two different folders instead of a single one. Why? Windows includes space into the
folder's name, and thus 'md' command considers creating two directories. Two folders will be created when time is then 10 a.m., e.g. when it can be represented with a single digit.
To solve this problem, we decided to remove space between the date and time. Here is the proper code to create directory with such name:
set d=%date%_%time:~0,2%.%time:~3,2%
set dt=%d: =%
md %dt%
This code will always create a single folder any time you call it.

Monday, December 7, 2009

Dr.Batcher 2.0.1 Is Released

We're glad to introduce Dr.Batcher 2.0.1, a new version of our award-winning batch files creation utility. Though this is just a minor update, it brings some really useful features and improvements for every user of Dr.Batcher. Here are some of them:
  • Support for nested compound commands
  • Support for extended 'IF' syntax
  • Arabic translation
  • Batch scripts parser improved
  • Lots of small bugfixes.
You can download a new version here. Hope you'll enjoy it.

Thursday, December 3, 2009

Comments in Batch Scripts

Do you know how to comment a line in a batch script? Sure most of you know that it is possible with 'REM' at the start of certain line. But there are still some alternative ways. These ways are really popular among batch files creators but they can produce some unexpected errors while the execution of a batch file.
The most popular commenting style for batch scripts looks like this:
:: This is a comment
And the other one looks even simpler:
: This can also be a comment
You know that batch files syntax says that names of labels start with ":" character. So the comments above are labels for the batch files interpreter. And this is the source for some specific errors. For example, if you add such comment into blocks of code inside IF or FOR statements (between brackets), you'll see the error message. So you need to write comments before the beginning of such code block, or use traditional 'REM' instead of colons.