jeffspost
jeffspost

Reputation: 339

Need to Run Windows Security Dialog Box from Command Line

You know, what you normally get when typing ctrl-alt-del or ctrl-alt-end. Except in this scenario I can't press those keys, but I want to launch that box. Specifically I want to be able to pull up the change password dialog from the command line.

Thanks

Upvotes: 1

Views: 19800

Answers (4)

Greg
Greg

Reputation: 1

OSK.exe will bring up an on screen keyboard. It should allow you to hit ctrl-alt-del

Upvotes: 0

Benilda Key
Benilda Key

Reputation: 3092

Here is an extension of the answer given by Raymond Chen. I shows how to call the WindowsSecurity from a batch file. Note that it will only work properly when connected by a terminal session to 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);
}

Upvotes: 4

Raymond Chen
Raymond Chen

Reputation: 45173

You call the Shell.WindowsSecurity method. The documentation includes sample code.

Upvotes: 2

Eric H
Eric H

Reputation: 236

control.exe password.cpl - will launch the password Control Panel applet.

Upvotes: -1

Related Questions