Friday, December 18, 2015

Dr.Batcher Sales 80% OFF

Hello! We’re excited to announce that Mental Works Computing Software will soon be featuring Dr.Batcher on BitsDuJour, a ‘deal-of-the-day’ website that we’ve partnered with.
BitsDuJour will be offering Dr.Batcher on Thursday 24 December, 2015 for $9.99, normally Dr.Batcher is $49.95!
If you have any friends who might be interested in Dr.Batcher please let them know about the date. We can’t afford to offer this kind of thing often, and it will be available on BitsDuJour for a single day only.
Just tell them to visit http://www.bitsdujour.com on Thursday 24 December, 2015 to get Dr.Batcher for $9.99.
If you visit http://www.bitsdujour.com right now you can click the ‘I Want This’ button and you’ll be sure not to miss it!
http://www.bitsdujour.com/software/drbatcher

Friday, October 25, 2013

Commands'Section at Dr.Batcher Web Site

We are glad to introduce the new section of drbatcher.com. It is called Batch File Commands and here you can find a lot of information about the most commonly used batch file commands.
If you have any suggestions or improvements please contact us.
Also we are glad to announce that we have started woring on Dr.Batcher 3.0. Hope we'll be able to release the beta version of it up to the New Year.

Tuesday, September 3, 2013

Using PUSHD and POPD Commands in Batch Files

There are two really handy commands that are not very commonly used by the batch files' developers. They are named PUSHD and POPD. If you are familiar with Assembler, you may guess what these commands do. The first one stores the folder name (pushes directory) in some internal stack, and the second one brings it back (pops directory). Note that you can put several folders to the stack and them restore them in the reversed order (LIFO - last in, first out). It is much handier sometimes to use PUSHD/POPD instead of using special variables to store folders like in other programming languages.
Here's small example of using these commands:
ECHO Performing some file manipulations in one directory
REM Here are manipulations
REM Remembering this folder
PUSHD
CD AnotherFolder
ECHO Performing some file manipulations in another directory
REM Here are manipulations
REM Remembering this folder
PUSHD
CD YetAnotherFolder
ECHO Performing some file manipulations in this directory
REM Here are manipulations
REM Deleting temporary files in YetAnotherFolder
POPD
REM Deleting temporary files in AnotherFolder
POPD
REM Deleting temporary files in the first folder
REM That's all
So you should remember about these commands while you create batch files.
We kindly remind that Dr.Batcher is the best program to create batch file, both .BAT and .CMD, try it if haven't tried it yet. 

Tuesday, August 6, 2013

Using Quotes in Batch Files

It is likely that using quotes is a hard topic for everyone who strats learning batch programming. We'll try to clarify this question a bit.
Quotes is just the way to pass the parameters containing spaces. Let's see an example:
DIR c:\Program Files
It seems that it's all right, and we'll list files and folders from Program Files directory. But this is wrong opinion because the space in batch files is delimiter for parameters passing to the batch command.To pass the single argument to the DIR command you should quote it:
DIR "c:\Program Files"
Quotes is not the part of the folder name. They only let the command know that space is the part of this name.
We kindly remind that Dr.Batcher is the best program to create batch file, both .BAT and .CMD, try it if haven't tried it yet. 

Wednesday, July 17, 2013

Why to Use Variables in Batch Files?

When you write your own batch file, you usually have no need to use  many variables in your code. Batch files with all their GOTOs and old syntax make you hard-code all needful data directly into the batch file instead of trying to make your code a bit flexible. Is this a good practice? We suppose it isn't.
Once written, code with variables can be easily copied to many different new batch scripts. Any you have no need to waste time trying to understandd your old code. Using variables makes your code much more readable and reusable, and this is the main advantage of using them.
The most useful tip is to use system variables instead of hard-coding different Windows folders. For example, it's better to use %SystemRoot% instead of writing directly "c:\Windows". You can watch all system variables by running SET command without any parameters. You can also see all actiual values of system variables in Dr.Batcher. Tools -> Environment Variables:
We kindly remind that Dr.Batcher is the best program to create batch file, both .BAT and .CMD, try it if haven't tried it yet.

Friday, July 12, 2013

Hot to Clean Thumbnail Cache

Thumbnails are the great time-savers helping us to find the needful documents (especially images) when we need them. But still thumbnails need a lot of disk space because Windows stores them in a cache in order to save time needed to generate them. And when disk space is quite law, you need to clean thumbnail cache. Here is a  simple batch file that can help you in this task:
@ECHO off
TITLE Cleaning Thumbnails...
ECHO ***This Batch File Clears The Thumbnail Cache***
ECHO Cleaning Now...
GOTO s
:s
DEL /F /Q %userprofile%\AppData\Local\Microsoft\Windows\Explorer\*.db
ECHO Thumbnail Cache Successfully Cleared!
PAUSE
We kindly remind that Dr.Batcher is the best program to create batch file, both .BAT and .CMD, try it if haven't tried it yet. 

Tuesday, July 2, 2013

Delete All Files Except Specified Ones

Sometimes it is neccessary to delete all files in a folder except some of them that are still useful. Here is small batch script that lets you delete all files except the specified ones. The parameter you pass to  this  script is the wildcard of files you want to leave.
@ECHO OFF
MD SAVE
XCOPY %1 SAVE > NUL

ECHO Y | DEL . > NUL
MOVE SAVE\*.* . > NUL
RD SAVE
ECHO Done
We kindly remind that Dr.Batcher is the best program to create batch file, both .BAT and .CMD, try it if haven't tried it yet. 

Thursday, June 27, 2013

Batch File to Calculate Disk Space

If you need to calculate disk space used by a directory or by some files, the batch file below can be useful for you. If you call it with the parameter /d it lists each subdirectory. Without any parameters it just prints the total number of files and bytes.
@echo off
if not '%1=='/d goto howmuch1
dir /a-d /s|find "i"|find /v "Volume"|more
goto done
:howmuch1
dir /a-d /s|find "file(s)"|sort /r|find /n "f"|find "[1]"

We kindly remind that Dr.Batcher is the best program to create batch file, both .BAT and .CMD, try it if haven't tried it yet. 

Thursday, June 13, 2013

Batch File to Kill a Process

Sometimes it is necessary to kill a process from a batch file. Here is a small script that shows you batch file to kill a process:
tasklist|find /i "process.exe">nul & if errorlevel 1 (echo No such process!) else (taskkill /f /im process.exe /t)
You need to replace process.exe with the name of your process to be killed. You can find additional information on the commands taskkill and tasklist on Microsoft website.
We kindly remind that Dr.Batcher is the best program to create batch file, both .BAT and .CMD, try it if haven't tried it yet. 

Wednesday, June 5, 2013

Path to Microsoft Office Folder

If you want to perform some manipulations with MS Office or just check the existance of this software on a computer running Windows, you don't have to find the path to Microsoft Office folder manually. All you need to do is running quite a small batch script that you can see below:
for /L %%i in (15,-1,7) do call :GetPath %%i
goto :end
:GetPath
reg query HKLM\Software\Microsoft\Office\%1.0\Common\InstallRoot /v Path
if errorlevel 1 goto :end
acregl.exe "%TEMP%\SetPath.cmd" OFFICE_PATH HKLM\Software\Microsoft\Office\%1.0\Common\InstallRoot Path ""
call "%TEMP%\SetPath.cmd"
del "%TEMP%\SetPath.cmd" 2>&1
:end

As far as you can see, this script searches for path to Microsoft Office folder for different versions of Microsoft Office, from 7.0 (MS Office 97) to 15 (MS Office 2013). For future versions you should just increase the starting number in 'for' loop at the first  line of this script.
After executing this script you'll find path to Microsoft Office folder in OFFICE_PATH variable.
Also you need to place acregl.exe to the folder with your batch file before executing this script. You can find it in your 'Windows' folder on system drive.
We kindly remind that Dr.Batcher is the best program to create batch file, both .BAT and .CMD, try it if haven't tried it yet. 

Sunday, June 2, 2013

How to Delete Files from the Specified List (Batch Script)

There is quite a common task for batch file programming which is called 'Deleting Files from Specified List'. It is not hard to perform this operation. Here is a small batch script that may help you with this task:
SET LstName=
FOR /F %%i in ('type %LstName%') do DEL %%i
PAUSE
The only thing you need to do is specifying your own files list. What is this list? It is is simple text file with one name of file to be removed per one line. For example:
c:\Temp\*.*
d:\Dir\Data1.tmp
e:\Work\Temp\*.dat
etc.
We kindly remind that Dr.Batcher is the best program to create batch file, both .BAT and .CMD, try it if haven't tried it yet. 

Wednesday, May 29, 2013

Calculate Folder Size in Batch File

It is neccessary sometimes to calculate the size of a certain folder in batch file. Though it is easy to see the size of a folder in Windows, calculating it in a batch script can be considered quite a complicated task. This small script will help you with this task:
@Echo Off
For /F "Tokens=3*" %%a In (
'Dir /-C C:\Temp ^| Find "files"') Do Echo The C:\Temp folder size = %%a
pause
Of course you should first change 'c:\Temp' to path to the folder which size you want to calculate.
We kindly remind that Dr.Batcher is the best program to create batch file, both .BAT and .CMD, try it if haven't tried it yet. 

Wednesday, May 22, 2013

Dr.Batcher 2.3.2 Is Out!

We are glad to announce Dr.Batcher 2.3.2 - the new version of award-winning tool designed to create batch files. Here is  the list  of new features and improvements in this version:
  • Highlighting labels in source code
  • Support for dragging commands from left panel to souce code in Professional mode
  • 'Never Ask Again' option in 'Delete Command' prompt in Simple mode
  • Highlihting opening and closing brackets in Professional mode
  • Lots of bugfixes
Download Dr.Batcher from official Web site.

Tuesday, May 14, 2013

Batch Files GTR and LSS: How to Compare Numbers in Batch Files

Comparing numbers in batch files is not difficult. Usually  you don't need to compare numbers in batch files very often, but sometimes  it is neccessary. What do you need to do to compare two numbers in batch file?
There are two main operators that can help you compare numbers in batch file. They are named GTR and LSS. The first command says whether the first number is greater than the second one, the second command says whether the first number is less than the second one. Here are the examples of their usage:
SET Nmbr1=100
SET Zero=0
IF %Nmbr1% GTR %Zero%   ECHO Greater than zero
Or:
SET Nmbr2=10
SET Hundred=100
IF %Nmbr2% LSS %Hundred%   ECHO Less than one hundred
You can make them nested:
IF %Nmbr2% LSS %Hundred% ( IF %Nmbr1% GTR %Zero% (ECHO  Greater than zero but less than one hundred)
We kindly remind that Dr.Batcher is the best program to create batch file, both .BAT and .CMD, try it if haven't tried it yet. 

Monday, May 6, 2013

Difference between Call and Start

You may know that you can run a program or a batch file from your own batch file with the help of commands 'start' and 'call'. Both of them are used quite often, but what's the difference between them?
'Call' command pauses the execution of your batch file until the end of working of the called program or script. You can see it by creating a test batch file with a single 'pause' command. Save this test script as 'tst.cmd' and create batch file with text 'call tst' (no quotes). You'll see that your batch file waits for the end of execution of tst.cmd.
'Start' command starts the program or script in independent mode.  Change 'call' in your batch file to 'start'. You'll see that the main batch file closes its window while 'tst.cmd' is still running.
We kindly remind that Dr.Batcher is the best program to create batch file, both .BAT and .CMD, try it if haven't tried it yet. 

Monday, April 29, 2013

How to Clean Temp Folders

We have already discussed how to clean temp folders in this blog. But there are more ways to clean temp folders, and here we'll show one more of them. You can see the batch file that will clean all temporary files on your computer below.

cd %windir%\Temp
del /s /q %windir%\Temp\*.*
md %windir%\Temp


cd %userprofile%\AppData\Local
del /F /S /P %userprofile%\AppData\Local\*.tmp
md %userprofile%\AppData\Local

cd %userprofile%\AppData\Local\Temp
del /F /S /P %userprofile%\AppData\Local\Temp\*.tmp
md %userprofile%\AppData\Local\Temp

cd %userprofile%\AppData\LocalLow
del /F /S /P %userprofile%\AppData\LocalLow\*.tmp
md %userprofile%\AppData\LocalLow

cd %userprofile%\AppData\Roaming
del /F /S /P %userprofile%\AppData\Roaming\*.tmp
md %userprofile%\AppData\Roaming


This batch file is suitable for Windows Vista and newer operating systems.
We kindly remind that Dr.Batcher is the best program to create batch file, both .BAT and .CMD, try it if haven't tried it yet. 

Thursday, April 25, 2013

Batch File to Send a File to All Computers in Network

Sending a single file to all computers in the network is quite a common task for Windows system administrators. It is handy to have a script that will automate this process. Here is the batch file to send a file to all computers in network:
REM Mass File Sender
REM Sends the specified file to all computers
REM in your network. 


REM Don't forget to replace "compyfile" before
REM executing this script.
SET copyfile=SomeFile.ext
net use S: /delete /y
@net view  | @FOR /F "tokens=1" %%c in ('@find "\\" ') do (
net use S: %%c\c$\bin
COPY %copyfile% S:\ /y
net use S: /delete /y
)

You should just change 'copyfile' to the path to the needful file before executing this script. You should also remember that sending large files can make your network very slow.
We kindly remind that Dr.Batcher is the best program to create batch file, both .BAT and .CMD, try it if haven't tried it yet. 

Monday, April 22, 2013

.BAT or .CMD?

What's the difference between the extensions of batch files? As you may know, they can have extensions .BAT or .CMD. What's the 'right' extension for today?
BAT files were known since the early DOS age, and you can run BAT file both from DOS, old Windows (3.1, 95, 98...) and modern Windows up to Windows 8. CMD files were introduced as the replacement for BAT files. We still call them 'batch files', but it is more convenient to call them 'command files'. The old versions of Windows and of couse MS-DOS don't recognize these files as executable ones.
So it is better to save the files that you want to run under old operating systems with .BAT extension, and all others save with .CMD extension.
We kindly remind that Dr.Batcher is the best program to create batch file, both .BAT and .CMD, try it if haven't tried it yet.

Friday, April 19, 2013

Remove Files Completely

It is necessary sometimes to remove files completely from a certain folder. It is handy to perform such action with the help of batch files.
Here you can find a small and useful script that might help you to clear the folder from all folders and files inside:
@echo off
echo ***Warning***
echo ***This Will Delete All Files and Folders Permanately!***
echo ***You Will Be Prompted To Confirm File Deletion...***
echo ***Verify All Files Before Deletion...***
del /P /S %1
pause

How to use this script? Save it (for example, as clearfiles.bat) and run from the command prompt with the folder to be cleaned as a parameter. For example:
clearfiles d:\Work\Old\Trash
We kindly remind that Dr.Batcher is the best program to create batch file, try it if haven't tried it yet.

Monday, April 15, 2013

Dr.Batcher 2.3.1 Is Available

We are glad to introduce Dr.Batcher 2.3.1 - the new version of award-winning tool designed to create batch file. In this version you'll find:
  • Checking for existance of files in list while adding to EXE or backup
  • Parsing '^' character in a right way
  • Automatic update enhanced
  • Lots of small bugfixes
Download Dr.Batcher from official Web site.

Translate