Hey Geek-9pm after I drove home from work I was thinking more about it and was like maybe it can be passed to the clipboard and back out to set variables.
Researched today about this and clipboards functionality is a 1 way door from command shell to clipboard and there are no instructions that allow you to pass the clipboard contents to set a variable for use later in the batch. However others have wanted to do this and this article here has what would work for me maybe.
https://stackoverflow.com/questions/17819814/how-can-you-get-the-clipboard-contents-with-a-windows-commandBasically I need folder names of 4 folders that I get from DIR /B *static_folder_name where I am dealing with folders that have prepended alpha-numerics but the tail end of the folder names are static and unique among the rest of the folders in the root of where the project is. The unknown folder name is then known from getting it from DIR /B and passed to variable to be used later in batch. Doing this one at a time to |clip the output and pass the clipboard to a SET /p variable and then get the next folder name and do the same setting the variables and then the batch is populated with the 4 folder names and no writing to file and deletion of temp files.
So I tried out DIR /B *static_folder_name | clip and this passes the output to clipboard but cant do anything with it beyond that unless you use a tool like Paste.exe that someone created to be able to pass the clipboard contents back into command shell.
So I am going to play around with this. There is also a powershell method too that I am going to play around with that doesnt need the 3rd party Paste.exe to function but if working with older OS's that dont have power shell it would be neat to have the Paste.exe as a solution to that to earlier versions of Windows.
The project I have that handles the 4 folders works completely fine with the original method of writing to temp files and then the cleanup, but if I get this clipboard method to work I will implement that just because it seems cleaner than writing files of redirected output and deleting those files when complete.