本帖最后由 WHY 于 2018-8-4 20:47 编辑
- @echo off
- for /f "tokens=4,*" %%i in ('dir /x /ad ^| findstr "~[1-9].*\.$"') do (
- echo ren %%i "%%~nxj"
- )
- pause
复制代码
- @if(0)==(0) echo off
- for /f "tokens=1*" %%i in ('dir /b /ad /s ^| findstr \.$ ^| sort /r ^| cscript //nologo //e:jscript "%~f0"') do (
- echo ren %%i "%%j"
- )
- pause & goto :EOF
- @end
-
- var fso = new ActiveXObject('Scripting.FileSystemObject');
-
- while(!WSH.StdIn.AtEndOfStream){
- var fd = WSH.StdIn.ReadLine();
- var objFolder = fso.GetFolder('\\\\?\\' + fd + '\\');
- var shortPath = objFolder.ShortPath.substr(4);
- var newName = objFolder.Name.replace(/\.+$/, '');
- WSH.Echo(shortPath + ' ' + newName)
- }
复制代码 Win10 中文专业版 1803 测试通过
Win10 创建和获取后面带点的文件夹时,点的个数与 Win7 有区别,Win7 的话自己修改吧。 |