如何重命名多个子文件夹中多个文件的扩展名(.jpg)?(How to rename the extension (.jpg) of multiple files in multiple subfolders?)
我正在收集我所有的家庭相册,主要有几百个子文件夹,里面有数百张图片。 如何转换所有这些画廊而不在每个子文件夹中复制bat文件并在每个文件夹中运行它?
我有超过1k的画廊,请帮忙!
这是我试图写的命令:
@ECHO OFF FOR /f "delims=*" %a IN ('dir *.jpg /b /s') do REN "%a" *.png
但是不行不通,我不知道我做错了什么..
PS:文件夹和子文件夹仍然在通用位置,我没有固定的,因为我总是将文件从磁盘移动到其他人。 我正在使用Windows 8.1。
I am collecting all my family albums in a main one with hundreds of subfolders that inside have hundreds of images. How I can convert all this galleries without to copy in each subfolder the bat file and run it in every folder?
I have more than 1k of galleries, please help!
This is the command what I tried to write:
@ECHO OFF FOR /f "delims=*" %a IN ('dir *.jpg /b /s') do REN "%a" *.png
But insn't work and I don't know what I'm doing wrong..
PS: The folder and subfolders are still in generic location, I don't have a fixed one because I always move the files from a disk to others. I'm using Windows 8.1.
原文:https://stackoverflow.com/questions/35072793
最满意答案
使用Make
shell
内置的MY_VAR=$(shell echo whatever)
me@Zack:~$make MY_VAR IS whatever me@Zack:~$ cat Makefile MY_VAR=$(shell echo whatever) all: @echo MY_VAR IS $(MY_VAR)
Use the Make
shell
builtin like inMY_VAR=$(shell echo whatever)
me@Zack:~$make MY_VAR IS whatever
me@Zack:~$ cat Makefile MY_VAR := $(shell echo whatever) all: @echo MY_VAR IS $(MY_VAR)
相关问答
更多-
TCP/IP模型是一个________。[2023-05-19]
a -
您需要在shell命令中双重转义$字符: HEADER = $(shell for file in `find . -name *.h`;do echo $$file; done) 这里的问题是make会试图将$f扩展为一个变量,并且因为它找不到任何东西,所以它只是用“”替换它。 这只会让你的shell命令除了echo ile ,它忠实地执行。 添加$$告诉make在该位置放置一个$ ,这会导致shell命令完全按照您希望的方式查看。 You will need to double-escape the ...
-
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
如何将Bash命令的输出分配给变量?(How to assign the output of a Bash command to a variable? [duplicate])[2022-09-27]
尝试: pwd=`pwd` 要么 pwd=$(pwd) 注意等号之后没有空格。 韦斯先生指出, 你不分配给$pwd ,你分配给pwd 。 Try: pwd=`pwd` or pwd=$(pwd) Notice no spaces after the equals sign. Also as Mr. Weiss points out; you don't assign to $pwd, you assign to pwd. -
使用Make shell内置的MY_VAR=$(shell echo whatever) me@Zack:~$make MY_VAR IS whatever me@Zack:~$ cat Makefile MY_VAR=$(shell echo whatever) all: @echo MY_VAR IS $(MY_VAR) Use the Make shell builtin like in MY_VAR=$(shell echo whatever) me@Zack:~$make MY_VA ...
-
您的方法存在两个问题。 1)make make在执行任何规则之前解析makefile的条件部分。 这个: all: LAST_EXIT=0 ifeq ($(LAST_EXIT), 0) #echo a message indicating success endif 不会报告成功(除非您在规则之上的某处设置LAST_EXIT的值)。 2)配方中的每个命令都在自己的子shell中执行; shell变量值不会从一行保留到下一行: all: LAST_EXIT=5; echo the ...
-
在另一个帖子中找到答案。 将命令的返回值写入临时文件然后读取它。 set REPORTfilename=%TEMP%/%random%.txt call echo %%!argument_Count! >%REPORTfilename% set /p REPORT=<%REPORTfilename% echo " REPORT " %REPORT% Found an Answer in another thread. writing the return value of command to a te ...
-
我猜你应该使用$(shell ...)函数初始化月份变量: month := $(shell $(R_HOME)/bin/Rscript ./R/reportperiod.R) I guess you should use $(shell ...) function to initialize month variable: month := $(shell $(R_HOME)/bin/Rscript ./R/reportperiod.R)
-
要将某些命令的输出分配给变量,您需要使用命令替换: variable=$(command) 对于你的情况: c=$(echo {b%?} |rev | cut -d '/' -f 1 | rev) 只是想知道为什么不试试 basename ${b} 要不就 echo ${b##*/} home1 如果要修剪路径中的最后一个数字,请执行以下操作: b="/home/home1" echo $b /home/home1 b=${b//[[:digit:]]/} c=$(echo ${b##*/}) ec ...
-
你的语法应该是 read ENE <<<$(awk '{print $1}' file) 你也可以直接分配价值 ENE=$(awk '{print $7}' temp) 你也可以使用shell $ var=$(< temp) $ set -- $var $ echo $7 或者你可以把它读成数组 $ declare -a array $ read -a array <<<$(
相关文章
更多- Solr4:Tomcat7与Solr之多核配置(Multiple Cores)
- elasticsearch too many open files
- OSGi 中为什么还有Eclipse Extension point的方式?
- Hadoop Java程序-files功能测试
- 怎样把tiff文件转换成jpg格式的啊?(在线!要源码,谢谢)
- Canvas上的画出来的东西怎么存储jpg/png图片?
- flume写入Hadoop hdfs报错 Too many open files
- 删除暴风文件夹内的stormliv.exe
- 在java中如何获取文件夹占用空间的大小?(注意这里不是问文件夹大小)
- Hadoop控制输出文件命名
最新问答
更多- 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
- 如何通过引用返回对象?(How is returning an object by reference possible?)
- 矩阵如何存储在内存中?(How are matrices stored in memory?)
- 每个请求的Java新会话?(Java New Session For Each Request?)
- css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
- 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
- xcode语法颜色编码解释?(xcode syntax color coding explained?)
- 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
- 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
- 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
- 西安哪有PLC可控制编程的培训
- 在Entity Framework中选择基类(Select base class in Entity Framework)
- 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
- 电脑二级VF有什么用
- Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
- 金华英语角.
- 手机软件如何制作
- 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
- 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
- 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
- Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
- 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
- python的访问器方法有哪些
- DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
- 在Ruby中对组合进行排序(Sorting a combination in Ruby)
- 网站开发的流程?
- 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
- 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
- 透明度错误IE11(Transparency bug IE11)
- linux的基本操作命令。。。