List a directory folder to a variable

前端 未结 1 497
遇见更好的自我
遇见更好的自我 2021-01-28 22:49

I felt it was better to ask this separately rather than expect an answer from my comment on my previous post.

I already have variables set for the directory number

1条回答
  •  无人共我
    2021-01-28 23:37

    dir d09854* /b will recover the full folder name in one line, without the extra cruft, if that's any use? What are you writing this widget in? Does it have to be Good Old Fashioned DOS, or can the newer Command extensions be used?

    With limited old DOS, I can't think of a way to get that into a SET Variable without piping it to a temporary batch file, having first ECHO'd a set variable= into it, and using >> in the pipe to append to it... and then CALL the temporary batch file to execute the command!

    0 讨论(0)
提交回复
热议问题