Showing posts with label batch. Show all posts
Showing posts with label batch. Show all posts

Friday, January 7, 2022

DOS batch file: Expand * into list of filenames in command line

expand-wildcard.bat

@echo off

setlocal EnableDelayedExpansion


set params=command

for %%a in ("%~1") do (

    set params=!params! %%a

)


echo %params%

%params%

 

Then, running the following command:

C:\>expand-wildcard filename*


Will be executed as following:

C:\>command filename1 filename2 filename3 filename4 ..

Learning System Design with Cute Animation

 This one is superb -  https://designed-to-scale.vercel.app/