Unfortunately, shntool doesn't have any graphical user interface, it is a command line executable.

Since command line is so unfriendly, the best option is to set up batch files so we don't have to type any annoying command line when using shntool.


           What is a batch file ?

It is a simple .txt file renamed to .bat that contains a little script.
This script has instructions for a command line executable usually found in our "path folder". In this case, the command line executable is shntool.exe. We need to have it in our path folder.
The "path folder" is C:\WINDOWS\system32 [on WinXP/ Win2003]
C:\WINNT\ [on WinNT/ Win2K]
C:\WINDOWS\ [on Win95/ Win98]

So, the first thing you need to do is:

Extract this zip to your path folder : shntool 2.0.3.zip
The zip contains shntool.exe, cygwin1.dll and the latest versions of flac.exe, mac.exe, shorten.exe
For full shntool 2.0.3 documentation, click here.


 
 

 

Now, the whole idea is to associate .bat files with the desired file-extensions through the
Windows explorer/Tools menu. (in this case: .ape, .flac, .shn, and .wav extensions)
Once you've associated your .bat files with those extensions, it will be as simple as right-clicking
an .ape file for example (or .flac, .shn, .wav) and selecting an "action".
You'll find a file association how-to with screenshots in the file association section.
File association will only require 5 minutes of your time and you'll only have to do it once.

In the end, right-clicking a file is actually faster and easier than using a program with a graphical user interface.


 

 

- The  len  function

As an example,
we will use the following .bat script to retrieve info about the wav files residing "inside" .ape files:

The above script will create a .txt file named "wavinfo.txt". It will be created in the folder containing the ape file you right-clicked.
You won't have to right-click every single ape file in the folder.
You will just have to right-click one ape file in a folder, select the desired " shntool action" and every ape file will be scanned inside that folder.
It will take a couple seconds for the .txt to be created, and then, you'll be able to read the resulting info, like in the following example:

The above "wavinfo.txt" has been created after calling for the " len " function of shntool.
" len " stands for lenght, but it will actually give you more info than just lenght .
In the "wavinfo.txt" above, every file appears to be fine, there are no errors.

When there's a "b" in the cdr column, like in the following example, it means "sector boundary error":

 

   
 

 

- The fix function

There are other functions available in shntool.
The ones that we will really need are " len " and " fix ".

- script example using the fix function:

The above script will fix sector boundary errors for the affected files and create a .txt with info
regarding the fixing process.

If no sector boundary errors are found, the " fix " function will not operate.
It will just let us know there is "no need for fixing".
With the above script, fixed files will be in .wav format. We could have specified an output format other than .wav but it is recommended to recompress the files with our usual frontends instead of
recompressing with shntool.

 

   
 


The primary use of shntool is to scan lossless files for errors, that's really what the " len " function is for.
We will therefore need a .bat file dedicated to the " len " function.
Then, with a .bat using the " fix " function, we'll be able to fix sector boundary errors, if there are any.

That's 2 kinds of .bat files we will be using.

Now, you don't even have to write those .bat files...

The following zip contains all 8 .bat files you will really need:

shntool batch files.zip

2 .bat files for the .ape extension : 1 for the len function, 1 for the fix function.
2 .bat files for the .flac extension : idem
2 .bat files for the .shn extension : idem
2 .bat files for the .wav extension : idem


Now, let's associate those .bat scripts with their respective file extensions in order to use shntool
straight from the right-click menu.