我想爲用戶創建公共桌面上的快捷方式,但此捷徑的此目標路徑導致了一些問題。PowerShell中創建快捷方式的目標路徑問題
$wshshell = New-Object -ComObject WScript.shell
$desktop = [System.Environment]::GetFolderPath("desktop")
$lnk = $wshshell.CreateShortcut("$desktop\CLMCPDEDEV.lnk")
$lnk.TargetPath = "C:\Program Files (x86)\Unisys\WebEnabler\Web Enabler.exe" "configfile=c:\development-installs\web-enabler-config\CLMCPDEDEV.cfg"
我在另一個文件夾中的配置文件和exe是在不同的路徑。我是電源外殼新手,我如何繞過"C:\Program Files (x86)\Unisys\WebEnabler\Web Enabler.exe"
和"configfile=c:\development-installs\web-enabler-config\CLMCPDEDEV.cfg"
之間的空間?當我手動完成這個時,這是完整的捷徑。任何指導非常感謝。
是否把一個單引號之前' 「C:'和'後.CFG」'幫助嗎? –