1.

Solve : batch command for different file type?

Answer»

Hello

i have thousands files in directory and different 3-5 file type...
i wanna execute diffrent profiles to file types...

EXAMPLE jobs...

if file_ext = *.txt
do
"c:\execute\vt.exe" "profiles\prf1.pf"  "*.txt"

if file_ext = *.xml
do
"c:\execute\vt.exe" "profiles\prf2.pf"  "*.xml"

if file_ext = *.xml
do
"c:\execute\vt.exe" "profiles\prf3.pf"  "*.XLS"

.................

i will start one job and will do different job for different file types

how i can do ?

thxIf vt.exe just MODIFIES the files then try this:


Code: [Select]echo off
for %%a in (*.txt) do "c:\execute\vt.exe" "profiles\prf1.pf"  "%%a"
for %%a in (*.xml) do "c:\execute\vt.exe" "profiles\prf2.pf"  "%%a"
for %%a in (*.xls) do "c:\execute\vt.exe" "profiles\prf3.pf"  "%%a"
pause
very NICE code

thank you bro



Discussion

No Comment Found