Have you ever wanted a quick shortcut on your clients that would allow you to access the Software Center, ConfigMgr Control Panel Applet and the CCM logs folder by just running a simple variable? Well the script below will automate the entire process for you. The following variables will be configured in the script:
- CM
- Launches the Configuration Manager Control Panel Applet
- CMSC
- Launches the Software Center
- CMLogs
- Opens %SystemRoot%\CCM\Logs
This makes accessing these commonly used resources as easy as hitting Windows + R and typing CM, CMSC, or CMLogs on the client machine.
Powershell Script:
$QuickcutDir = "C:\IT\Quickcuts"
If(!(Test-Path $QuickcutDir)) {
New-Item $QuickcutDir -ItemType Directory -Force
}
$Shortcut = (New-Object -ComObject WScript.Shell).CreateShortcut("$QuickcutDir\CM.lnk")
$Shortcut.TargetPath = "$($env:SystemRoot)\CCM\SMSCFGRC.cpl"
$Shortcut.WorkingDirectory = "$($env:SystemRoot)\CCM"
$Shortcut.IconLocation = "$($env:SystemRoot)\CCM\SMSCFGRC.cpl,0"
$Shortcut.Save()
$Shortcut = (New-Object -ComObject WScript.Shell).CreateShortcut("$QuickcutDir\CMLogs.lnk")
$Shortcut.TargetPath = "$($env:SystemRoot)\CCM\Logs"
$Shortcut.WorkingDirectory = "$($env:SystemRoot)\CCM"
$Shortcut.IconLocation = "$($env:SystemRoot)\system32\imageres.dll,3"
$Shortcut.Save()
$Shortcut = (New-Object -ComObject WScript.Shell).CreateShortcut("$QuickcutDir\CMSC.lnk")
$Shortcut.TargetPath = "softwarecenter:"
$Shortcut.IconLocation = "$($env:SystemRoot)\CCM\scclient.exe,0"
$Shortcut.Save()
$Path = (Get-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Control\Session Manager\Environment").Path
$NewPath = "$QuickcutDir;" + $Path
If($Path -notlike "*$QuickcutDir*") {
Set-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Control\Session Manager\Environment" -Name Path -Type String -Value "$NewPath"
}
Get-Process Explorer | Stop-Process