Tag: dos

Useful DOS Commands

From time to time a DOS batch (“bat” or “cmd”) file needs to be written to perform some task or series of tasks. There are various commands that I seem to consistantly search for on the Internet. Here is a list of some of those useful DOS batch commands. How to delete files equal to zero bytes in size. Delete…

Read More »

DOS Batch – Find and Replace all occurrences of a string with another string

A fantastic write-up for a batch file, DOS Batch – Find and Replace, that allows string substitution in a text file. It parses each line of a text file for a particular string and replaces it with another string. For example, to replace all occurrences of “red” in “color.txt” with “blue” and put the output on the screen. The script…

Read More »

Use DOS Batch to show last month date with the date command

Use a DOS script to automate a process where by using the date /T command would return the previous month, rather than the current month. This actually sounds easier than it is. For the desired results, a couple of conditions were considered. Firstly, if in the month of January or one, then the subtracted value of one minus one equals…

Read More »