
求問批處理怎么樣才能正確獲取programfiles完整長路徑最后由 mario 于 -3-29 14:32
當(dāng)程序在c:program filestest目錄下總是失敗,在其他目錄則正常,測試發(fā)現(xiàn)AppPath需要完整使用c:program filestest長路徑才會正常但%~dp0返回的是c:progra~1test求問大佬要怎么樣才能正確獲取c:program filestest的長路徑nclick="copycode($('code0'));">復(fù)制代碼
- set ExePath=%~dp0
- set AppPath=%ExePath:=%
- wmic.exe process where Name='test.exe' and executablepath like '%%%AppPath%%%' get ProcessId /value>id.txt

