How to call a Windows script package with wildcard file names as command line arguments

I have a small version of windows script that does nothing but print all of its command line arguments (proba.bat)

@echo off :loop if "%~1"=="" goto cont echo %1 shift & goto loop :cont 

I expected this script to print all .mp4 files if I name it like this:

 proba *.mp4 

But instead, it just prints * .mp4 literally. It would be so simple on linux, but here I cannot get it to work. What am I doing wrong?

thanks

+6
source share
1 answer

Emulates what you are trying to do:

 @echo off for %%a in ("%~1") do echo "%%a" 
+2
source

All Articles