can anyone teach me the right way? here is my attempt code:
@echo off
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
"%~dp0..\x64\mediainfo.exe" --Inform=General;%%UniqueID/String%% "%~dp0..\files\SOURCE.avi" | clip
this is what I got:
272951594390852679981592891584486079797 (0xCD58909D52AF1297B61A0656EC307D35)
this is what I need:
90852679981592891584486079797 (0xCD58909D52AF1297B61A0656EC30
basiclly to strip-off the output (by factor of 10 positions from left and 5 from right) and send it to clipboard. (hope its clear and thank you in advance)
SOURCE.avineeds to be"%~dp0..\files\SOURCE.avi"so I tried to redo it but it doesnt work >>For /f "tokens=1" %%A in ('"%~dp0..\x64\mediainfo.exe" --Inform=General;%%UniqueID/String%% "%~dp0..\files\SOURCE.avi"') Do set "varA=%%A" Echo=%varA:~10,-5% | clip– gamer0 May 24 '18 at 14:02for /fneeds to escape the=and/or;in the mediainfo command with a caret^to not split into several arguments. That worked here with different arguments for a different .avi file. – LotPings May 24 '18 at 14:27'C:\Temp\X' is not recognized as internal or external command, operable command or batch fileso I guess that %~dp0 part is not evaluated as it should by FOR ? – gamer0 May 24 '18 at 14:48'to backquotes\`` or remove theusebackq` – LotPings May 24 '18 at 14:51C:\Temp\X\scripts\bat.batmediainfo:
C:\Temp\X\x64\mediainfo.exeavi:
C:\Temp\X\files\source.aviand I need to use
– gamer0 May 24 '18 at 15:21%~dp0in my batchfor /f, the moment there are two double quoted elements in the command it errors out, with only one d'quoted - either mediainfo or the avi it works here. – LotPings May 24 '18 at 16:03set "%~dp0..\x64\mediainfo.exe"=mediainfoalias(but this one doesnt work) and then use "alias" in FOR like:For /f "delims=" %%A in (' %mediainfoalias% --Infor...?? – gamer0 May 24 '18 at 16:16"%~dp0..\..", so I will go with my own solution (provided below), however I am greatfull. – gamer0 May 25 '18 at 17:24