![](/img/trans.png)
[英]How to rename all files with " - yyyy mm dd hh mm" in file name to just the part before date/time?
[英]Rename files, moving date part of name from beginning to end
我的文件名帶有名稱開頭的日期,例如20171015….txt
。
我目前使用批處理文件去除前 8 個字符,並且效果很好。 但是我現在想保留日期但將其移到文件名的末尾。
將不帶擴展名的文件名設置為變量%Variable%
:
Ren "%Variable%.ext" "%Variable:~8%%Variable:~,8%.ext"
或者,如果在某種循環中執行並啟用延遲擴展,即SetLocal EnableDelayedExpansion
:
Ren "!Variable!.ext" "!Variable:~8!!Variable:~,8!.ext"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.