-1
我創建了一個小的PowerShell腳本來刪除Autodesk應用程序。但是,PowerShell不會像系統變量%username%那樣接縫。什麼是在Powershell中實現這一點的最佳方式?Powershell腳本刪除臨時文件和註冊表鍵
# Remove all Autodesk products from a Windows System
$AutoDeskPaths = "C:\Users\%username%\AppData\Roaming\Autodesk", "C:\Users\%username%\AppData\Local\Autodesk", "C:\ProgramData\Autodesk", "C:\Program Files\Autodesk\AutoCAD 2012", "C:\Program Files\AutoCAD 2010", "C:\Program Files\Common Files\Autodesk Shared","HKCU:Software\Autodesk", "HKLU:Software\Autodesk"
Remove-item $AutoDeskPaths -Recurse
只是讓你休息認識。這是我使用的最後一個腳本。從Windows系統中刪除所有Autodesk產品 $ AutoDeskPaths =「C:\ Users \ $ Env:UserName \ AppData \ Roaming \ Autodesk」,「C:\ Users \ $ Env:UserName \ AppData \ Local \ Autodesk」 ,「C:\ ProgramData \ Autodesk」,「C:\ Program Files \ Autodesk \ AutoCAD 2012」,「C:\ Program Files \ AutoCAD 2010」,「C:\ Program Files \ Common Files \ Autodesk Shared」 :Software \ Autodesk「,」HKLU:Software \ Autodesk「 刪除項目$ AutoDeskPaths -Recurse – resolver101
然後接受答案。 – Tom