如何做多件事情每个文件在目录中的批处理脚本 [英] How to do multiple things to each file in a directory with a batch script

查看:103
本文介绍了如何做多件事情每个文件在目录中的批处理脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是这个问题的直接延伸:

<一个href=\"http://stackoverflow.com/questions/180741/how-to-do-something-to-each-file-in-a-directory-with-a-batch-script\">http://stackoverflow.com/questions/180741/how-to-do-something-to-each-file-in-a-directory-with-a-batch-script

从上面我凑近如何为一个文件夹中的每个文件执行命令。

你如何为每个文件执行多个命令?我想先用瘸子COM preSS文件,然后将原来的文件到不同的目录

这是我迄今为止:

  FOR / R cutAndPendingCom pression %%在f IN(*。*)DO跛%%˚FCOM pressed \\ %%〜NF -mm -b 16  - -vbr全新-V 9 --scale 2.5


解决方案

这做到了。

  FOR / R cutAndPendingCom pression %%在f IN(*。*)DO(
跛脚%%˚FCOM pressed \\ %%〜NF -m米-b 16 --vbr全新-V 9 --scale 2.5
移动%%˚F切\\ %%〜NF

This is a direct extension of this question:

http://stackoverflow.com/questions/180741/how-to-do-something-to-each-file-in-a-directory-with-a-batch-script

From the above I leaned how to execute a command for every file in a folder.

How do you execute MULTIPLE commands for each file? I want to first use lame to compress the file, then MOVE the original file to a different directory

This is what I have so far:

FOR /r cutAndPendingCompression %%f IN (*.*) DO lame %%f compressed\%%~nf -m m -b 16 --vbr-new -V 9 --scale 2.5

解决方案

This did it

FOR /r cutAndPendingCompression %%f IN (*.*) DO (
lame %%f compressed\%%~nf -m m -b 16 --vbr-new -V 9 --scale 2.5
move %%f cut\%%~nf
)

这篇关于如何做多件事情每个文件在目录中的批处理脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆