how do I repeat a command in cmd for every file I have in a [closed] folder

0

I have a folder with many .iso files (d: \ isos). I want to compress them with gzip and I need to create a loop for each .iso that is in that folder to execute gzip.exe filex.iso and so on until it compresses all the files in the folder.

I hope I have been clearer with the question.

Thanks

    
asked by alfredo alonso 01.12.2017 в 01:04
source

1 answer

1
for %%f in (C:\path\to\files\*.txt) do (
    :: El comando que quieras realizar sobre los ficheros. %%f sera el fichero.
)

About this I hit you, you must modify the route and also the format depending on what you are working on.

Greetings,

    
answered by 01.12.2017 в 11:38