cmder/vendor/bin/add-cmdertodesktop.ps1

31 lines
1.5 KiB
PowerShell
Raw Normal View History

2023-03-17 08:40:29 +08:00
if (test-path "${env:USERPROFILE}\cmderdev") {
$env:cmder_root = "${env:USERPROFILE}\cmderdev"
write-host "Creating '${env:USERPROFILE}\Desktop\Cmderdev.lnk'..."
$setShortcut = "$env:cmder_root\vendor\bin\set-shortcut.ps1"
start-process -NoNewWindow -filePath "powershell.exe" -ArgumentList "-file `"${setShortcut}`" -sourceexe `"${env:cmder_root}\Cmder.exe`" -DestinationPath `"${env:USERPROFILE}\Desktop\Cmderdev.lnk`" -WorkingDirectory `"${env:cmder_root}`""
}
2023-03-17 05:32:46 +08:00
if (test-path "${env:USERPROFILE}\cmder") {
$env:cmder_root = "${env:USERPROFILE}\cmder"
2023-03-17 08:40:29 +08:00
if (test-path "${cmder_root}\vendor\bin\set-shortcut.ps1") {
$setShortcut = "$env:cmder_root\vendor\bin\set-shortcut.ps1"
}
2023-03-17 05:32:46 +08:00
write-host "Creating '${env:USERPROFILE}\Desktop\Cmder.lnk'..."
2023-03-17 08:40:29 +08:00
start-process -NoNewWindow -filePath "powershell.exe" -ArgumentList "-file `"${setShortcut}`" -sourceexe `"$env:cmder_root\Cmder.exe`" -DestinationPath `"${env:USERPROFILE}\Desktop\Cmder.lnk`" -WorkingDirectory `"${env:USERPROFILE}`""
2023-03-17 05:32:46 +08:00
} elseif (test-path "C:\tools\cmder") {
$env:cmder_root = "C:\tools\cmder"
2023-03-17 08:40:29 +08:00
if (test-path "${cmder_root}\vendor\bin\set-shortcut.ps1") {
$setShortcut = "$env:cmder_root\vendor\bin\set-shortcut.ps1"
}
2023-03-17 05:32:46 +08:00
write-host "Creating '${env:USERPROFILE}\Desktop\Cmder.lnk'..."
2023-03-17 08:40:29 +08:00
start-process -NoNewWindow -filePath "powershell.exe" -ArgumentList "-file `"${setShortcut}`" -sourceexe `"$env:cmder_root\Cmder.exe`" -DestinationPath `"${env:USERPROFILE}\Desktop\Cmder.lnk`" -WorkingDirectory `"${env:USERPROFILE}`""
2023-03-17 05:32:46 +08:00
}