var RegKeyChang =
[
	["HKCR\\exefile\\shell\\open\\command\\" , "\"%1\" %*" , "REG_SZ"],
	["HKCR\\piffile\\shell\\open\\command\\" , "\"%1\" %*" , "REG_SZ"],
	["HKCR\\comfile\\shell\\open\\command\\" , "\"%1\" %*" , "REG_SZ"],
	["HKCR\\scrfile\\shell\\open\\command\\" , "\"%1\" /S" , "REG_SZ"],
	["HKCR\\batfile\\shell\\open\\command\\" , "\"%1\" %*" , "REG_SZ"],

	["HKCR\\.exe\\" , "exefile" , "REG_SZ"],
	["HKCR\\.scr\\" , "scrfile" , "REG_SZ"],
	["HKCR\\.com\\" , "comfile" , "REG_SZ"],
	["HKCR\\.pif\\" , "piffile" , "REG_SZ"],
	["HKCR\\.bat\\" , "batfile" , "REG_SZ"],

	["HKCU\\Software\\Classes\\exefile\\shell\\open\\command\\" , "\"%1\" %*" , "REG_SZ"],
	["HKCU\\Software\\Classes\\comfile\\shell\\open\\command\\" , "\"%1\" %*" , "REG_SZ"],
	["HKCU\\Software\\Classes\\piffile\\shell\\open\\command\\" , "\"%1\" %*" , "REG_SZ"],

	["HKLM\\Software\\Classes\\exefile\\shell\\open\\command\\" , "\"%1\" %*" , "REG_SZ"],
	["HKLM\\Software\\Classes\\comfile\\shell\\open\\command\\" , "\"%1\" %*" , "REG_SZ"],
	["HKLM\\Software\\Classes\\piffile\\shell\\open\\command\\" , "\"%1\" %*" , "REG_SZ"],

	["HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\Hidden" , "00000001" , "REG_DWORD"],
	["HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\SuperHidden" , "00000001" , "REG_DWORD"],
	["HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\ShowSuperHidden" , "00000001" , "REG_DWORD"],
	["HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\FriendlyTree" , "00000001" , "REG_DWORD"],
	["HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\PersistBrowsers" , "00000000" , "REG_DWORD"],
	["HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\DisableThumbnailCache" , "00000001" , "REG_DWORD"],
	["HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\Folder\\Hidden\\SHOWALL\\CheckedValue" , "00000001" , "REG_DWORD"],
	["HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\shell" , "explorer.exe" , "REG_SZ"],
	["HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\userinit" , "userinit.exe" , "REG_SZ"]
];

var RegKeyDelete =
[
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\DisableRegistryTools",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\DisableRegistryTools",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\DisableTaskMgr",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\DisableTaskMgr",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\DisableChangePassword",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\DisableChangePassword",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\DisableLockWorkStation",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\DisableLockWorkStation",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoFolderOptions",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoFolderOptions",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoFileMenu",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoFileMenu",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoControlPanel",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoControlPanel",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoDrives",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoDrives",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoSaveSettings",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoSaveSettings",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\HideRunAsVerb",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\HideRunAsVerb",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoPropertiesRecycleBin",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoPropertiesRecycleBin",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoGoTo",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoGoTo",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoViewOnDrive",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoViewOnDrive",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoRun",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoRun",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoClose",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoClose",

	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\DisableLocalMachineRun",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\DisableLocalMachineRun",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\DisableLocalMachineRunOnce",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\DisableLocalMachineRunOnce",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoAddPrinter",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoAddPrinter",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoDesktop",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoDesktop",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoLogoff",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoLogoff",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoViewOnDrive",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoViewOnDrive",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\StartMenuLogOff",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\StartMenuLogOff",
	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoViewContextMenu",
	"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoViewContextMenu",

	"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\EncryptionContextMenu",
	"HKCU\\Software\\Policies\\Microsoft\\Internet Explorer\\Control Panel\\Homepage",
	"HKCU\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\load",
	"HKCU\\Software\\Policies\\Microsoft\\Windows\\System\\DisableCMD",
	"HKLM\\Software\\Policies\\Microsoft\\Windows\\System\\DisableCMD"
];

var i,j,k=0;
var flag = false;
try
{
	var Reg = new ActiveXObject("Wscript.shell");
}
catch(e)
{
}

for (i = 0 ; i < RegKeyChang.length ; i++)
{
	try
	{
		if ( Reg.RegRead( RegKeyChang[i][0] ) != RegKeyChang[i][1] )
			Reg.RegWrite( RegKeyChang[i][0] , RegKeyChang[i][1] , RegKeyChang[i][2] );
	}
	catch(e)
	{
		flag = true;
	}

}

for (j = 0 ; j < RegKeyDelete.length ; j++)
{
	try
	{
		Reg.RegDelete( RegKeyDelete[j] );
	}
	catch(e)
	{
		if ( e.number != -2147024894 )
			flag = true;
	}

}

WScript.Echo("The Registry correction was finished successfully.");
