Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Batch ape decode (Read 3354 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Batch ape decode

How can I do a batch ape decode?
Something like this doesn’t work:

Code: [Select]
C:\path\mac *.ape -d

or
Code: [Select]
for %%i in (*.ape) do (C:\path\mac "%%i" -d & if errorlevel 1 pause)



I assume you must specify the output wave file.
Does someone have a solution for this?

Batch ape decode

Reply #1
You could use my ape-decode.bat.  Drag a folder or file onto the icon to run.  You will need to edit the file and change the pathToMac variable.

A command line alternative would be:

Code: [Select]
for %%i in (*.ape) do (C:\path\mac "%%i" "%%~dpni.wav" -d & if errorlevel 1 pause)

... which should decode all ape files to a wav of the same name, in the source folder.
I'm on a horse.

Batch ape decode

Reply #2
Works perfectly.

A assume  ~dpni is a functionality for batch variables.
Could be handy for other situations to.
I haven't found any documentation for that on the internet yet.
Any link would be helpful.

Batch ape decode

Reply #3
Try running:

Code: [Select]
FOR /?

You'll have to page down a bit to see:

Code: [Select]
In addition, substitution of FOR variable references has been enhanced
You can now use the following optional syntax:

    %~I         - expands %I removing any surrounding quotes (")
    %~fI        - expands %I to a fully qualified path name
    %~dI        - expands %I to a drive letter only
    %~pI        - expands %I to a path only
    %~nI        - expands %I to a file name only
    %~xI        - expands %I to a file extension only
    %~sI        - expanded path contains short names only
    %~aI        - expands %I to file attributes of file
    %~tI        - expands %I to date/time of file
    %~zI        - expands %I to size of file
    %~$PATH:I   - searches the directories listed in the PATH
                   environment variable and expands %I to the
                   fully qualified name of the first one found.
                   If the environment variable name is not
                   defined or the file is not found by the
                   search, then this modifier expands to the
                   empty string

The modifiers can be combined to get compound results:

    %~dpI       - expands %I to a drive letter and path only
    %~nxI       - expands %I to a file name and extension only
    %~fsI       - expands %I to a full path name with short names only
    %~dp$PATH:i - searches the directories listed in the PATH
                   environment variable for %I and expands to the
                   drive letter and path of the first one found.
    %~ftzaI     - expands %I to a DIR like output line

In essence %~dpnI will return the drive, path and filename excluding extension (which can be retrieved using %~xI) of the variable.
I'm on a horse.