Set Default Shell
Set Default Shell
$NAMESPACE = "root\standardcimv2\embedded"
# Create a handle to the class instance so we can call the static methods.
try {
$ShellLauncherClass = [wmiclass]"\\$COMPUTER\${NAMESPACE}:WESL_UserSetting"
} catch [Exception] {
write-host $_.Exception.Message;
write-host "Make sure Shell Launcher feature is enabled"
function Get-UsernameSID($AccountName) {
return $NTUserSID.Value
}
$ShellLauncherClass.SetEnabled($TRUE)
$IsShellLauncherEnabled = $ShellLauncherClass.IsEnabled()
$restart_shell = 0
$restart_device = 1
$shutdown_device = 2
$ShellLauncherClass.SetDefaultShell("C:\Windows\explorer.exe", $restart_shell)
$DefaultShellObject = $ShellLauncherClass.GetDefaultShell()
"`nDefault Shell is set to " + $DefaultShellObject.Shell + " and the default action
is set to " + $DefaultShellObject.defaultaction
$ShellLauncherClass.SetCustomShell($KIOSK_SID,"C:\Program Files
(x86)\MuralClient\MuralKioskAplikacija.exe", ($null), ($null), $restart_shell)
$ShellLauncherClass.SetCustomShell($ADMIN_SID,"C:\Windows\explorer.exe", ($null),
($null), $restart_shell)
$ADMIN_SID = Get-UsernameSID("Matan")
$ShellLauncherClass.SetCustomShell($ADMIN_SID,"C:\Windows\explorer.exe", ($null),
($null), $restart_shell)
https://docs.microsoft.com/en-us/windows-hardware/customize/enterprise/shell-
launcher
https://docs.microsoft.com/en-us/windows/configuration/kiosk-shelllauncher