Windows Security Dialog Box from the Command Line
4 answers
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 to share