I want to transfer the very first file returned
dir *.png /B
to the variable% firstFile%
Why do you need dir ?
dir
for %%x in (*.png) do if not defined firstFile set "firstFile=%%x"
why do you have to sort through the whole list?
for %%x in (*.*) do ( set "firstFile=%%x" goto :done ) :done
must not be:
DIR *.png /B > "%TEMP%\dir" && SET firstFile= < "%TEMP%\dir"
DIR *.png /B > "%TEMP%\dir" && < "%TEMP%\dir" SET firstFile=
Source: https://habr.com/ru/post/1400449/More articles:Not selected RowStyleSelector - .netMonitoring a variable to change in Python - pythonhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1400446/are-there-any-dangers-to-working-internally-in-utf-8-and-then-converting-to-utf-16-only-when-needed-in-windows&usg=ALkJrhjpztW0PUeR2vBzyJLZ64LW3ArQTgTo split a string into two in XPath - xmlNesting and syntax of nested functions - scopeWriting a setTimeout recursive loop in Coffeescript - javascripttrimming a string, deleting the last character in C # - c #MonoTouch / MonoDroid Service Level Incompatibilities? - androidHow to get TabItems in a TabControl that has an ItemsSource element associated with a list? - c #TPL How to correctly cancel a task - c #All Articles