tag:blogger.com,1999:blog-39497135455993299192024-03-13T23:33:58.481-07:00Dr.Batcher and the World of Batch FilesThis is a blog of Dr.Batcher's development team. <a href="http://www.drbatcher.com">Dr.Batcher</a> is the batch files creation and editing software providing you with the simplest way to create and edit batch files. So here you can find information on batch scripting techniques and development of Dr.Batcher.mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.comBlogger117125tag:blogger.com,1999:blog-3949713545599329919.post-53733062679241088892015-12-18T15:09:00.000-08:002015-12-18T15:09:02.608-08:00Dr.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 mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-75607471417846494042013-10-25T11:38:00.000-07:002013-10-25T11:38:01.077-07:00Commands'Section at Dr.Batcher Web SiteWe 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.mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com2tag:blogger.com,1999:blog-3949713545599329919.post-6446230205909254532013-09-03T15:50:00.001-07:002013-09-03T15:50:23.452-07:00Using 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 mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-36585862162726583322013-08-06T11:51:00.001-07:002013-08-06T11:51:27.612-07:00Using 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 mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-18006495270422841362013-07-17T05:14:00.002-07:002013-07-17T05:14:30.601-07:00Why 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 batchmental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-84604180839186376332013-07-12T12:14:00.000-07:002013-07-12T12:14:14.946-07:00Hot 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 mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-87340936534497063332013-07-02T12:22:00.000-07:002013-07-02T12:22:36.822-07:00Delete All Files Except Specified OnesSometimes 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 OFFMD SAVEXCOPY %1 SAVE > NUL
ECHO Y | DEL . > NUL
MOVE SAVE\*.* . > NUL
RD SAVE
ECHO Done
We kindly mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-73898725307464582642013-06-27T08:45:00.000-07:002013-06-27T08:45:12.316-07:00Batch File to Calculate Disk SpaceIf 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 offif not '%1=='/d goto howmuch1dir /a-d /s|find "i"|find /v "Volume"|moregoto done:howmuch1dir /a-d /s|find "file(s)"|sort /r|find /n mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-46870661050754802252013-06-13T16:26:00.003-07:002013-06-13T16:26:50.067-07:00Batch File to Kill a ProcessSometimes 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 mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-68860132858140452562013-06-05T08:49:00.003-07:002013-06-05T08:49:55.804-07:00Path 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 %%igoto :end:GetPathreg query HKLM\Software\Microsoft\Office\%1.0\Common\mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-77709826136751223192013-06-02T07:40:00.000-07:002013-06-02T07:40:10.052-07:00How 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 %%iPAUSE
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 mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-48317322277250511902013-05-29T09:52:00.000-07:002013-05-29T09:52:05.385-07:00Calculate 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 OffFor /F "Tokens=3*" %%a In ('Dir /-C C:\Temp ^| Find "files"') Do Echo The C:\Temp folder size = %%a pause
Of course mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-71955195290125111732013-05-22T06:24:00.000-07:002013-05-22T06:24:21.352-07:00Dr.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 andmental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-82081893300082059212013-05-14T13:11:00.000-07:002013-05-14T13:11:35.444-07:00Batch 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 mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com1tag:blogger.com,1999:blog-3949713545599329919.post-35501023620816424232013-05-06T17:24:00.000-07:002013-05-06T17:24:16.943-07:00Difference 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 mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-60831870912768764092013-04-29T13:32:00.000-07:002013-04-29T13:32:06.942-07:00How to Clean Temp FoldersWe 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%\Tempdel /s /q %windir%\Temp\*.*md %windir%\Temp
cd %userprofile%\AppData\Localdel /F /S /P %userprofile%\AppData\Local\*.tmpmd %userprofile%\mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-32317774267488237072013-04-25T06:34:00.002-07:002013-04-25T06:34:29.295-07:00Batch 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 SenderREM Sends the specified file to all computersREM in your network.
REM Don't forget to replace "compyfile" beforeREM executing mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-25986520786836799832013-04-22T15:02:00.002-07:002013-04-22T15:02:48.014-07:00.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 mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-61530289016029250522013-04-19T10:15:00.000-07:002013-04-19T10:15:34.067-07:00Remove 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 offecho ***Warning***echo ***This Will Delete All Files and Folders Permanately!***echo ***You Will Be Prompted To Confirm File mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-58934659345816998502013-04-15T16:17:00.000-07:002013-04-15T16:17:00.239-07:00Dr.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.mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-77471623003147803552013-04-02T15:45:00.001-07:002013-04-02T15:45:44.748-07:00Friday Bag Lunch: File Splitting and Combining<!--[if gte mso 9]>
Normal
0
false
false
false
EN-US
X-NONE
X-NONE
<![endif]-->
<!--[if gte mso 9]>
mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-42540049212415146752013-03-25T08:10:00.001-07:002013-03-25T08:11:32.012-07:00Clean AVG Temporary Files via Batch File
AVG is a great free antivirus quite popular among the users of Dr.Batcher. You can find it here. But as every software, it leaves sometimes some temporary files that should be cleaned manually by its user. Batch files are the best way to clear AVG temporary files.
Here is a small batch file that will help you to clean AVG temporary files:
CD "C:\Program Files (x86)\AVG\AVG8\"avgcfgex.exe /mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-6570896933053252212013-03-22T06:04:00.003-07:002013-03-22T06:05:10.280-07:00Windows Scripting Technologies: Create Batch File vs. Write in Other Scripting Languages<!--[if gte mso 9]>
Normal
0
false
false
false
EN-US
X-NONE
X-NONE
<![endif]-->
<!--[if gte mso 9]>
mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-66787840292751216492013-03-18T15:45:00.002-07:002013-03-18T15:45:41.767-07:00How to Merge Two Files with Help of Batch Script
Imagine: you have some spiltted files and you want to merge them into the new file containing all of them. Of course, it is much simpler to perform this operation using a small batch script instead of copying data manually. Here you can see an example of this batch script (hope, it'll be quite understandable with the comments):
REM Advanced Files MergerREM Adds files specified by mask to mental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0tag:blogger.com,1999:blog-3949713545599329919.post-89218095432160816562013-03-12T04:52:00.000-07:002013-03-12T04:52:03.478-07:00How to Find Desktop from Batch File
Sometimes it is necessary to operate with some files on desktop. It is easy to find a desktop itself :), but how to get the path to from a batch script? Here is a small bath script that might help you with this task.
ECHO chcp 1251 > 11.cmdFOR /f "skip=4 tokens=2,*" %%i in ('reg query "HKCU\software\microsoft\windows\currentversion\explorer\shell folders" /v desktop') do ECHO set desktop=%%jmental-workshttp://www.blogger.com/profile/18061194677919249615noreply@blogger.com0