Friday, August 13, 2010

Are Batch Files Still Alive?

There are lots of users and even system administrators who suppose batch files scripting to be dead. Why do they think so? The most common arguments are:
  • there are lots of modern scripting techniques (PowerShell, WSH, etc.) that are simple in use;
  • you can't make with help of batch files anything you want, or it's really difficult;
  • you have to use GOTO - possibly, it's the worst reason not to use batch files:)
Why do people still discuss about batch files on forums and blogs? Why don't they take all needful code and translate it into PowerShell? Possibly, batch files are not so bad. They have clear and simple syntax, you can run them under any version of Windows and they are usual for those who started to deal with computers in DOS era. That's why I can say: batch files are still alive. Don't agree? Wait for your comments!

Monday, August 2, 2010

Dr.Batcher 2.0.2 is released

After half a year of break Dr.Batcher 2.0.2 is released. In this version you will find:
  • group "echo" and "@" modifiers;
  • pop-up menu in Simple mode;
  • new options;
  • support for adding unknown commands in Simple mode;
  • 'Do not print this command in console during the execution' option in command editor;
  • new 'Create Batch File' dialog;
  • fixed parsing TAB characters;
  • small bugfixes in UI.
Here you can see how new 'Create Batch File' dialog looks:
You can find new version of Dr.Batcher here. Hope you'll enjoy it.

Monday, January 4, 2010

Installing Fonts Using Batch Files

Installing fonts is not really common task performing every day by thousands of people. Still one day you can understand that you are to install fonts with help of batch scripting. Fortunately it's really won't take a lot of time to create a batch file to install several fonts. You should just copy them into Fonts directory and add some keys to the Registry. Here is the batch script you are to execute:
copy font.ttf %systemroot%\fonts
regedit /s font.reg
The only trouble is that you have to create REG-file first. It will take a few moments to add the following lines to font.reg:
REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
"Font Name"="font.ttf"

Put down the real name of your font instead of "Font name" (leave commas). Also don't forget to reboot after the font's installation. That's all!

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: http://www.bitsdujour.com/software/drbatcher/

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.

Translate