[WINDOWS] patch: handle .cmd like .bat
#1
I've struggled a few hours to figure out how to launch a cmd script from from playercorefactory.xml, also tried calling calling cmd.exe etc, nothing worked. Knowing about the pitfalls of CreateProcess() from own experience, I decided to look at the source, and found there is already special handling for batch files in place which was everything I needed.

I'm just used to always name my batch files ".cmd" and never ".bat", to make clear they are only intended for cmd.exe and not for command.com ... never expected this would bite me so hard some day.

Maybe someone could please patch
xbmc/cores/ExternalPlayer/ExternalPlayer.cpp:

Code:
#if defined(_WIN32)
   // W32 batch-file handline
-  if (m_filename.Right(4) == ".bat")
+  if (m_filename.Right(4) == ".bat" || m_filename.Right(4) == ".cmd")
   {
     // MSDN says you just need to do this, but cmd's handing of spaces and
Reply
#2
Thanks Smile

Trac is the place for patches - we'll lose trac(k) of it otherwise.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
Ok, understood:
http://trac.xbmc.org/ticket/9221
Reply

Logout Mark Read Team Forum Stats Members Help
[WINDOWS] patch: handle .cmd like .bat0