Windows Security Dialog Box from the Command Line

You know what you usually get when you type ctrl-alt-del or ctrl-alt-end. Except for this scenario, I cannot press these keys, but I want to launch this box. In particular, I want to be able to display the password change dialog from the command line.

thank

+1


source to share


4 answers


You are calling the method Shell.WindowsSecurity

. The documentation contains sample code.



+2


source


Here is a follow-up to the answer given by Raymond Chen. I am showing how to call WindowsSecurity from a batch file. Note that it will only work when connected with a terminal session to a Microsoft Terminal Server.



@if (@CodeSection == @Batch) @then
@echo off

:: See https://gist.github.com/DavidRuhmann/5199433 and 
:: http://msdn.microsoft.com/en-us/library/windows/desktop/gg537748%28v=vs.85%29.aspx
:: for details.

CScript //E:JScript //Nologo "%~0" %*
exit /b

@end

try
{
    var objShell = new ActiveXObject("shell.application");
    objShell.WindowsSecurity();
    WScript.Quit(0);
}
catch(e)
{
    WScript.Quit(1);
}

      

+2


source


OSK.exe will open the onscreen keyboard. This should allow you to hit ctrl-alt-del

0


source


-1


source







All Articles