文件夹一键重命名求指导!!万分感谢
bat吧
全部回复
仅看楼主
level 1
各位大神好,我想实现文件夹一键重命名工作
第一步:我先批量修改了文件夹名称
出现情况:全部都带后缀括号
第二步:我去除了文件夹的括号
但是中间还留有空格
第三步:执行批量改名bat,但是还是不行。
求指导!
2019年08月12日 10点08分 1
level 9
问题要说到点上,所以说了那么多,还是不知道你要怎么重命名
2019年08月13日 05点08分 2
将下列文件夹,一键改为Excel里面的对应文件名。 感谢!
2019年08月13日 06点08分
level 1
将下列文件夹,一键改为Excel里面的对应文件名。
感谢!
2019年08月13日 06点08分 3
表里插入一行在最前面加REN然后复制到记事本再改bat然后运行就可以了
2020年11月07日 02点11分
level 9
以下代码复制粘贴到记事本,另存为xx.bat,编码选ANSI;将表格里的名称一个一行复制粘贴进“名称列表.txt”,将bat、txt跟多个文件夹放一起运行
<# :
echo off&cls
rem 将多个子文件夹一一对应分别重命名为一个指定txt文本文件内列出的多个新名称
set #=Any question&set _=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%_% %z%
cd /d "%~dp0"
powershell -NoProfile -ExecutionPolicy bypass "Invoke-Command -ScriptBlock ([ScriptBlock]::Create([IO.File]::ReadAllText('%~f0',[Text.Encoding]::GetEncoding('GB2312')))) -Args '%~f0'"
echo;%#% +%$%%$%/%_% %z%
pause
exit
#>
$txtfile='.\名称列表.txt';
$self=get-item -liter $args[0];
$path=$self.Directory.FullName;
$txtfile=$txtfile -replace '^\.',$path;
$codes=@'
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
public static class ExpDir
{
[DllImport("Shlwapi.dll", CharSet=CharSet.Unicode)]
public static extern int StrCmpLogicalW(string p1, string p2);
public static string[] Sort(string[] f)
{
Array.Sort(f, StrCmpLogicalW);
return f;
}
}
'@;
Add-Type -TypeDefinition $codes;
$text=[IO.File]::ReadAllLines($txtfile,[Text.Encoding]::Default);
$folders=@(dir -liter $path|?{$_ -is [System.IO.DirectoryInfo]}|%{$_.Name});
if($folders.count -ge 1){
$list=[ExpDir]::Sort($folders);
for($i=0;$i -lt $list.count;$i++){
if($text[$i] -ne $null){
($list[$i]+' --> '+$text[$i]);};};};
2020年11月07日 07点11分 6
level 3
2020年12月23日 01点12分 7
1