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.

Tuesday, April 2, 2013

Friday Bag Lunch: File Splitting and Combining



The only one who may not like Friday is the one who has to work on Saturday. I’m not used to working on Saturday and only fuss can spoil my Friday night. And it was fuss that I felt as soon as I’d set foot into my flat. Don’t think that there were lots of people. Rather! There was only my daughter, but she was getting ready for a party!!!
The light was on everywhere, on the floor in the hall there was a hair dryer with all kinds of combs and other dodgy things, in the nursery S60 were roaring “Death In Vegas” at full blast, something in the bathroom was soaking, an iron was warming on the kitchen table, all stove burners were on and something was boiling on them while the daughter herself was sitting at the computer, with another comb stuck in her hair.
“Hi!” – I shouted.
“Your hands around my throat” – the “Vegas” answered.
I felt like running out into the landing and killing the power supply at one go...
...If I had called my friends in time and our plan to go to play billiards hadn’t been ruined, then..
“Hi, Dad!” I heard a voice behind my back, turned around and was petrified. Have you ever tried to look a person in the eyes when these eyes are totally different?
“What’s wrong with your eye?”
“Which one? The painted or the other one?”
“I see.”
“If you’re hungry, salads will be ready soon and you can help yourself a bit”
“What do you mean: help yourself a bit?”
“I’ll take the rest with me. The girls told me to cook salads”
I needed to hide somewhere! The only thing I could do is to lock myself up in my room and turn the TV on.
“Dad, will you help me with burning a video CD?”
“What do you mean: help you? You know how to burn CDs”
“But it’s too large – almost 2 gigabytes. It needs to be written on 2 CDs and I don’t know how to do it.”
I had no thought of teaching my daughter in such conditions, but I’d nowhere to go.
Having seated myself at the computer and on legal grounds turned the music off, I started working my salads off.
“Actually, it’s a very simple task. You can split a movie into parts by Total Commander. But there might be problems with putting these parts together.
“Daddy, you’re so clever! What problems you may have?”
“Not me, but you! Or the one who is in charge of computers at your party.”
“Rick is. And it was he who asked me to bring this movie. He’s always good at everything. You just help me burn the film, and he’ll puzzle everything out.”
“I doubt it. I’ve seen these know-alls. To know how to solve a problem you have to face it once at least.”
“And what kind of problem it may be?”
“The question is if he has Total Commander on his computer. If he has, then it won’t be difficult to reassemble the movie. If he doesn’t have Total Commander, then it will be hard for me to explain to him, and especially to you, how to do this. The only option is to write a detailed instruction down on a sheet of paper or into a text file.
“Daddy, you’re great! Of course, do it! And I’ll go into the kitchen to get the salads done”.
“That’s a heck of a lesson.”- I thought. “You teach me here and I’ll go do other things...”
The music started booming again, but I had nowhere to go and got down to my work. But in order not to return to this question, I decided to make up not a brief but a detailed instruction for my daughter and her friend. That’s what came out.
File splitting and combining
File splitting may be necessary in cases when the size of a storage medium (a floppy disk, CD...) is smaller than the size of a file. We will carry out this operation by Total Commander. It’s a good idea to move the file into a different folder (so that a novice user will see the result of the operation) and open it both in the left and the right windows (otherwise the parts will be copied to the folder opened in the opposite window). Select the file (or just place the cursor on it) and choose “Split File” in the “File” menu (fig. 1). Then choose the size of the parts (in our case – matrixes of 700 Mb each) and click “Ok”. In the folder you will see the files of the parts (their extensions will be .001, .002, ...) and a .crc-file containing the information about the source file (its name, size and checksum).
It’s better to copy all the three files to the matrixes. Free space is more likely to be on a disk with the last part, so you may write the crc-file just there.
File combining
After copying all the files to a hard drive of another computer, to combine them with the help of Total Commander you just need to press Enter on the .crc file or choose “Combine” in the “File” menu. In doing so the file will be combined in a folder opened in the opposite window.
Failing Total Commander on your computer, you can combine the file out of its parts by using the copy function in command line or create a bat-file (a batch file which will contain the same copy command.)
Copy command settings
The copy command will be as follows:
copy /b movie.001 + movie.002 movie.avi
(The key /b means binary copy).
And it is this line that is obligatory in a bat-file.
The bat-file can be run directly from the explorer.
Bat-file creation
You can create a bat-file in Total Commander by pressing the buttons “Shift” + F4” or in a simple Notepad. When naming the file, you must change its extension into .bat. But the most comfortable way to create batch file is tool called Dr.Batcher.
This file will consist of only one line with a copy command (see above).


I reread the text once again. All details seemed to have been mentioned, but somehow I thought it would be right to write the finished bat-file to the second matrix along with the instruction. That would be more effective. Friday night is not the best time for study. Especially, at parties.
I left the computer to burn the CD and went to tell my daughter about the result of my work. Having heard the welcome news, she flashed a glance at me with the already-equally-painted eyes and said, shouting the hair dryer down:
“Thanks, Dad! Maybe you’ll burn for me some music too?”
“No way, you can deal with it by yourself, and I’ll go eat your salads”.
The salads were delicious, and the mood suited the Friday night again.
Roger Vadey,

Translate