Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

否可以在沒有 Python 的情況下在 Windows 中運行它? 是否可以一次轉換整個資料夾的檔案? #839

Open
ghost opened this issue Jan 17, 2024 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 17, 2024

抱歉我的電腦知識有限, 我是否可以在沒有 Python 的情況下在 Windows 中運行它? 是否可以一次轉換整個資料夾的檔案?

@ghost ghost changed the title 否可以在沒有 Python 的情況下在 Windows 中運行它? 是否可以一次轉換整個資料夾的檔案? 否可以在沒有 Python 的情況下在 Windows 中運行它? 是否可以一次轉換整個資料夾的檔案? Jan 17, 2024
@plum7x
Copy link

plum7x commented Feb 18, 2024

寫 PowerShell 腳本
用 Get-Item 與萬用字元路徑取得多個檔案資訊
例如

$fileInfos = Get-Item *.txt

注意,PowerShell 的萬用字元包括方掛號
用來表示範圍,例如 [A-Za-z] 為任一個英文字母
然而方掛號是個一般常用字元
若你不需要此功能可以用取代做自動逃脫

$path -replace '[\[\]\`]', '`$0'
$fileInfos = Get-Item $path

再用 FroEach ($fileInfo in $fileInfos) 處理所有檔案
檔案的完整路徑是 $fileInfo.FullName

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant