Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Batch File how to run all files in folder

I am trying to find a batch file command that will allow me to run all .lnk or .html files with in a folder. I tried using the wildcards (*.lnk) but this wouldn't work. Any ideas?

like image 546
swstrau118 Avatar asked Sep 06 '25 12:09

swstrau118


1 Answers

Based upon further comments, this should help - you don't need recursion to process a single folder, and this will handle long filenames.

@echo off
for %%v in ("C:\Users\username\Desktop\Test\*.lnk") do start "" "%%~v"

It will open every .lnk file in the folder.

like image 65
foxidrive Avatar answered Sep 10 '25 01:09

foxidrive