本帖最后由 WHY 于 2024-6-13 08:13 编辑
- PowerShell "dir *.txt -file | ?{$_.BaseName -match '[a-z]{2,}'} | forEach {$fd=$matches[0]; md $fd -ea SilentlyContinue; mv $_.FullName -Dest $fd}"
复制代码
- @if(0)==(0) echo off
- for /f "tokens=1*" %%i in ('dir /b /a-d *.txt ^| cscript -nologo -e:jscript "%~f0"') do (
- md %%i\ 2>nul
- move "%%j" %%i\
- )
- pause & exit/b
- @end
-
- while (!WSH.StdIn.AtEndOfStream) {
- var f = WSH.StdIn.ReadLine();
- var m = f.slice(0,-3).match(/[a-z]{2,}/i);
- if(m) WSH.Echo(m[0] + ' ' + f);
- }
复制代码
|