Is there a way to find out the MIME-TYPE (or is it called "Content-Type"...) of a file in windows batch/PowerShell?
For detecting MIME-types, use the aptly named "mimetype" command. It has a number of options for formatting the output, it even has an option for backward compatibility to "file". But most of all, it accepts input not only as file, but also via stdin/pipe, so you can avoid temporary files when processing streams.
Ctrl + Shift + I.
In the Connections pane, go to the site, application, or directory for which you want to add a MIME type. In the Home pane, double-click MIME Types. In the MIME Types pane, click Add... in the Actions pane. In the Add MIME Type dialog box, add the file name extension and MIME type, and then click OK.
While not directly in the Windows command prompt, a more modern approach is to use Git for Windows. Once installed, run git-bash
and the command file path\to\file
. An example output might be:
TestFile.ico: MS Windows icon resource - 1 icon, 128x128, 32 bits/pixel
Alternatively, use the command file -i path\to\file
which might give:
TestFile.ico: image/vnd.microsoft.icon; charset=binary
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With