0

so I have written a batch that worked as I intended to. After I rebooted my windows however, I ran the batch again, and for some reason it wouldn't work anymore.

After breaking it down, eliminating/simplifying some code I found out that the problem has something to do with the MediaInfo CLI. Here's the full code of the batch:

@echo off
set MEDIAINFO=C:\Progra~1\MediaInfo\MediaInfo.exe
set TEMPLATE=H:\test\Audio.txt

%MEDIAINFO% --Inform=file://%TEMPLATE% test.dts >H:\test\test.txt
pause

The template (Audio.txt) just contains:

Audio;%BitRate/String%

So as you can see, I broke it down to be super basic; and it even worked again after some time - without changing anything -, but after I rebooted again, it didn't work.. So, I know this sounds odd, but something must have triggered it to work again. I have no clue what that might have been though.

I'm pretty confused as to why this is happening, so any help would be much appreciated.
PS: Sorry if my grammar might not be correct, but English is not my native language.

user3033137
  • 15
  • 1
  • 5
  • 1
    What was the failure behavior? Were there any specific error messages? – David Ruhmann Aug 13 '15 at 18:37
  • What appears when you remove the `@echo off` line? – lit Aug 13 '15 at 19:03
  • 1
    When the machine restarts, are you sure that the H: drive letter is mapped. Before running the script, use `NET USE` to see if it is connected. – lit Aug 13 '15 at 19:04
  • @DavidRuhmann: No error messages. Just an empty output file is created (test.txt) – user3033137 Aug 13 '15 at 19:09
  • @Paul : When I remove the `@echo off` line, everything is printed with paths just as normal. And yes, H: is mapped. Also tried it on different drives. Last time I rebooted the computer was ~30 minutes ago, still not working, so whatever is triggering it to work, I did not trigger it yet. – user3033137 Aug 13 '15 at 19:17
  • Have a look at https://msdn.microsoft.com/en-us/library/Aa767731(v=VS.85).aspx – lit Aug 13 '15 at 19:25
  • I was thinking the same thing, that maybe you should change `--Inform=file://%TEMPLATE%` to `--Inform="file:///%TEMPLATE:\=/%"`. Also, just for the sake of convention, `set "MEDIAINFO=%PROGRAMFILES%\MediaInfo\MediaInfo.exe"` with the "var=value" pair quoted, and call it like `"%MEDIAINFO%" --Inform...` (or is MediaInfo in `%PROGRAMFILES(x86)%`?) – rojo Aug 13 '15 at 19:53

0 Answers0