Disable manage server screen (Perl)
This code can be found in
Chapter 2 of Windows Server Cookbook
Purchase XP Cookbook or Networking Recipes for only $25 plus shipping! While supplies last.
Find out how to download all of the Perl code from this site.
# This code disables the Manage/Configure Your Server screen for all users
# (this only applies to users that have not logged in yet)
# ---------------------------------------------------------------
# Adapted from VBScript code contained in the book:
# "Windows Server Cookbook" by Robbie Allen
# ISBN: 0-596-00633-0
# ---------------------------------------------------------------
use Win32::OLE;
$Win32::OLE::Warn = 3;
# ------ SCRIPT CONFIGURATION ------
$intEnable = 0; # 0 = disable screen; 1 = enable screen
$strComputer = '.'; # name of target server
# ------ END CONFIGURATION ---------
use constant HKU => 0x80000003;
$strKeyPath = '.DEFAULT\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Setup\\Welcome';
$strValue = 'srvwiz';
$objReg = Win32::OLE->GetObject('winmgmts:\\\\' . $strComputer . '\\root\\default:StdRegProv');
$intRC = $objReg->SetDwordValue(HKU, $strKeyPath, $strValue, $intEnable);
if ($intRC != 0) {
print 'Error setting registry value: ' . $intRC, "\n";
}
else {
print "Successfully disabled screen\n";
}
|
This code has been viewed 907 times.
|
New from the creators of TechTasks.com:
StatSheet.com
|