Batch - Remove file-ending (that contains an asterix) from path
<p>I need a way of removing the file-ending from a path, but I'm unable to do it if the file-ending contains an asterix, e.g. *.xsd , Any ideas on how to do this?</p>

<p>Sample batch script:</p>

<pre><code>SET xsd_path=xsd\file.xsd  REM This does work
SET xsd_path=xsd\*.xsd     REM This does not work

FOR %%i IN ( "%xsd_path%" ) DO ( set xsd_filepath=%%~pi )
ECHO "Filepath: %xsd_filepath%"
</code></pre>