I have this command in my windows's script (.cmd file):
CALL mv *.exe foo.exe
The wildcard character doesn't seem to be be interpreted as a wildcard at all, because the when the script is executed, it throws an error about not finding a file with name *.exe
(literally *.exe). There is a .exe file in the current directory, by the way.
So how should I rewrite this command? Thanks
If mv
is available, maybe you have sh.exe
or bash.exe
nearby. Then it's easy:
sh.exe -c "mv *.exe foo.exe"
CMD interpreter doesn't expand wildcards, unlike unix shells: commands do (or don't do) it by themselves. Maybe builtin ren
command will expand wildcard, but I'm unsure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With