本帖最后由 newswan 于 2024-7-27 23:07 编辑
回复 3# woyaowork - @echo off
- setlocal ENABLEDELAYEDEXPANSION
-
- set P=%CD%\
-
- for /f "usebackq tokens=* delims=" %%a in (` dir /s /ad /b `) do (
- set a=%%a
- echo !a:%P%=!
- )
复制代码 powershell- $folder = "D:\"
- $outfile = "out.txt"
-
- $n = $folder.Length
-
- Get-ChildItem -Recurse -LiteralPath $folder | ForEach-Object {
- $_.FullName.Substring($n)
- } | Out-File -LiteralPath $outfile -Encoding "UTF8"
复制代码
|