Batch.exe

Downloads
1.5.2
2015
Stable
Migration planned

Batch.exe is a simple tool that processes files and directories. It reads Batch.xml placed in the same directory and processes the specified tasks. When "-q" is added to the command line, the scripts terminates after execution without waiting for input.

Batch.xml

The XML file is made up of any number of tasks. As for now, there are 3 possible actions: "UnblockFiles", "DeleteFiles" and "RecycleFiles".

For instance, "UnblockFiles" removes the blocked flag from a file, which you usually get when downloading something using a browser or copy from a network source. This is the annoying and unwanted dialog I'm talking about:

Batch.xml Examples

This particular Batch.xml processes the deletion of cache files created by Windows Media Player:

Note: You can define multiple locations and/or tasks in one XML file. Also, as you can see, the filters support a wildcard character. You can also use "DeleteFiles" instead of "RecycleFiles" if preferred.

<?xml version="1.0" encoding="utf-8"?>
<Batch>
	<Task Action="RecycleFiles">
		<Locations>
			<Location Path="D:\Music" />
			<Location Path="D:\Movies" />
		</Locations>
		<Filters>
			<Filter Pattern="AlbumArt_{*}_Large.jpg" />
			<Filter Pattern="AlbumArt_{*}_Small.jpg" />
			<Filter Pattern="AlbumArtSmall.jpg" />
			<Filter Pattern="desktop.ini" />
			<Filter Pattern="Folder.jpg" />
			<Filter Pattern="Thumbs.db" />
		</Filters>
	</Task>
</Batch>

This example is to remove the blocked flag from all files in two specific locations:

<?xml version="1.0" encoding="utf-8"?>
<Batch>
	<Task Action="UnblockFiles">
		<Locations>
			<Location Path="D:\Downloads" />
			<Location Path="D:\Network Share" />
		</Locations>
		<Filters>
			<Filter Pattern="*" />
		</Filters>
	</Task>
</Batch>