Это файл старт. Ярлык с неко на запуск программы. Так же прикрепил весь архив со скриптами.
//--------------------------------------------------------------------
// Start Script
//--------------------------------------------------------------------
var FlagSys = "FUSO"; // MMC or FUSO
var strVer = "6.0.2900.2180"; // IE Ver for XP SP2
var strOS = "5.1"; // Windows XP OS Version
var ExeName = "UpDateMain.exe"; // Active check Program
var ChkExeName = "iexplore.exe"; // IE Program
var strREG1 = "HKLM\\SOFTWARE\\Microsoft\\Internet Explorer\\Version";
var strREG2 = "HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_LOCALMACHI NE_LOCKDOWN\\iexplore.exe";
var strREG3 = "HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_LOCALMACHI NE_LOCKDOWN\\Settings\\LOCALMACHINE_CD_UNLOCK";
var strREG4 = "HKCU\\Software\\Microsoft\\Windows\\CurrentVersio n\\Run\\IeOptionOffTB";
var strREG5 = "HKCU\\Software\\Microsoft\\Windows\\CurrentVersio n\\Explorer\\Shell Folders\\Local Settings";
var strREG6 = "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\CurrentVersion";
var strREG7 = "HKLM\\SOFTWARE\\MMC\\MUT3_TB\\MUT\\APP\\LANGUAGE" ;
// 2010/11/03 Add Start
var strREG8 = "HKCU\\Software\\Microsoft\\Windows\\CurrentVersio n\\Explorer\\Shell Folders\\Local AppData";
// 2010/11/03 Add End
var StartObj, IE, WshShell;
var COMPLETED = 4;
var filename;
var pKey1, pKey2;
var SysPath;
var TempPath;
var strVerPC;
var strVerOS;
var Pid = 0;
var Mut3Sys;
var flgReg = false;
var valie = 0;
var valcd = 0;
var vfile;
var tfile;
var ifile;
var lang;
var mfile;
var mes;
var Kick;
var sfile;
var encode;
var CharsetCD;
var MutKickflg = true;
var cfile;
var WshShell = WScript.CreateObject("WScript.Shell");
if (FlagSys == "MMC")
{
Mut3Sys = "MUT3";
StartObj = new ActiveXObject("rkk.rkk_com");
}
else
{
Mut3Sys = "MUT3_TB";
StartObj = new ActiveXObject("rkk_com_tb.rkk_com_tb");
}
//Get Top Directory(Build Path)
pKey1 = "Software\\Mmc\\" + Mut3Sys + "\\Common\\Build";
pKey2 = "path";
SysPath = StartObj.Get_Registry(pKey1 , pKey2);
sfile = SysPath + "\\" + Mut3Sys + "\\MENU\\SCRIPT\\IeOptionOffTB.js";
vfile = SysPath + "\\" + Mut3Sys + "\\TEMP\\VEHICLE.DAT";
cfile = SysPath + "\\" + Mut3Sys + "\\TEMP\\02CHECK.DAT";
// Access Check
try {
StartObj.Set_Information(cfile,"ENV", "STATUS", "OK");
}catch(e){
WshShell.Popup("Please perform by account of Administraor authority.", 0, "MUT3",16);
WScript.Quit();
}
if (StartObj.Get_Information(cfile,"ENV", "STATUS", "NG") == "NG")
{
WshShell.Popup("Please perform by account of Administraor authority.", 0, "MUT3",16);
WScript.Quit();
}else{
StartObj.Set_Information(cfile,"ENV", "STATUS", "NG");
}
// Set Option Flag for IE Ver of XP SP2
strVerPC = WshShell.RegRead( strREG1 );
try {
strVerOS = WshShell.RegRead( strREG6 );
}catch(e){
strVerOS = "0.0"
}
if ((ChkVer(strVer,strVerPC) >= 0 ) && (ChkVer(strOS,strVerOS) >= 0 ))
{
// 2010/11/03 Add Start
var num = parseFloat(strVerOS);
// 2010/11/03 Add End
//Get Pid(IE)
Pid = StartObj.Get_ProcID(ChkExeName);
if (Pid == 0)
{
//Get Top Directory(Temp Path)
// 2010/11/03 Modify Start
// TempPath = WshShell.RegRead( strREG5 );
if (num >= 6.0)
TempPath = WshShell.RegRead( strREG8 );
else
TempPath = WshShell.RegRead( strREG5 );
// 2010/11/03 Modify End
tfile = TempPath + "\\TEMP\\IeOptionTB.DAT";
if( (StartObj.Get_Information(vfile,"ENV","CAESARKICK" ,"0") == "1" ) || (StartObj.Get_Information(tfile,"ENV","MUT3OFF","0 ") == "1" ) )
{
valie = StartObj.Get_Information(tfile,"ENV","VALUEIE","1" );
valcd = StartObj.Get_Information(tfile,"ENV","VALUECD","0" );
}else{
try {
valie = WshShell.RegRead( strREG2 );
valcd = WshShell.RegRead( strREG3 );
}catch(e){
valie = 1;
valcd = 0;
}
StartObj.Set_Information(tfile,"ENV", "VALUEIE", valie);
StartObj.Set_Information(tfile,"ENV", "VALUECD", valcd);
}
WshShell.RegWrite( strREG2, 0 ,"REG_DWORD" );
WshShell.RegWrite( strREG3, 1 ,"REG_DWORD" );
WshShell.RegWrite( strREG4, sfile ,"REG_SZ" );
flgReg = true;
}else{
try {
valie = WshShell.RegRead( strREG2 );
valcd = WshShell.RegRead( strREG3 );
}catch(e){
valie = 1;
valcd = 0;
}
if (( valie == '0' ) && ( valcd == '1' ))
{
//Get Top Directory(Temp Path)
// 2010/11/03 Modify Start
// TempPath = WshShell.RegRead( strREG5 );
if (num >= 6.0)
TempPath = WshShell.RegRead( strREG8 );
else
TempPath = WshShell.RegRead( strREG5 );
// 2010/11/03 Modify End
tfile = TempPath + "\\TEMP\\IeOptionTB.DAT";
if( (StartObj.Get_Information(vfile,"ENV","CAESARKICK" ,"0") == "1" ) || (StartObj.Get_Information(tfile,"ENV","MUT3OFF","0 ") == "1" ) )
{
valie = StartObj.Get_Information(tfile,"ENV","VALUEIE","1" );
valcd = StartObj.Get_Information(tfile,"ENV","VALUECD","0" );
}else{
valie = WshShell.RegRead( strREG2 );
valcd = WshShell.RegRead( strREG3 );
StartObj.Set_Information(tfile,"ENV", "VALUEIE", valie);
StartObj.Set_Information(tfile,"ENV", "VALUECD", valcd);
}
flgReg = true;
}else{
lang = StartObj.Get_Information(vfile,"ENV","LANGUAGE2ID" ,"E");
mfile = SysPath + "\\" + Mut3Sys + "\\MENU\\"+ lang + "\\MSG\\INDEX.csv";
// strREG7 = strREG7 + "\\" + lang + "\\CHARSET";
// CharsetCD = WshShell.RegRead( strREG7 );
// ifile = SysPath + "\\" + Mut3Sys + "\\MENU\\" + lang + "\\INI\\02MUT3ENV.ini";
// encode = StartObj.Get_Information(ifile,"CODE", CharsetCD, "1252");
// mes = StartObj.Get_Message(mfile,"003",encode);
mes = StartObj.Get_Message(mfile,"003");
WshShell.Popup(mes , 0, "MUT3",16);
flgReg = false;
MutKickflg = false;
}
}
}
//Get Pid
Pid = StartObj.Get_ProcID(ExeName);
if (Pid == 0)
{
if (MutKickflg == true)
{
tfile = TempPath + "\\TEMP\\IeOptionTB.DAT";
filename = "\\" + Mut3Sys + "\\Menu\\Html\\start.htm";
IE = WScript.CreateObject("InternetExplorer.Application ");
// 2010/11/03 ADD START
var Shell, SWindows, hwnd, ix, wcount;
hwnd = IE.HWND;
// 2010/11/03 ADD END
IE.Visible = false;
IE.Navigate(SysPath + filename);
// 2010/11/03 ADD START
//while(true)
//{
// if(IE.readystate == COMPLETED) break;
//}
try {
while(true)
{
if(IE.readystate == COMPLETED) break;
}
} catch(e) {
Shell = WScript.CreateObject("Shell.Application");
SWindows = Shell.Windows();
while(true)
{
for(wcount = 0; wcount < SWindows.Count; wcount++)
{
try {
ix = SWindows.Item(wcount);
if (ix != null && hwnd == ix.HWND)
{
IE = ix;
break;
}
} catch(e) {
}
}
if (!IE.busy && IE.readystate == COMPLETED)
break;
WScript.Sleep(100);
}
SWindows = null;
Shell = null;
}
// 2010/11/03 ADD END
StartObj.Set_Information(tfile,"ENV", "MUT3OFF", "1");
IE.Quit();
}
}
else
{
lang = StartObj.Get_Information(vfile,"ENV","LANGUAGE2ID" ,"E");
mfile = SysPath + "\\" + Mut3Sys + "\\MENU\\"+ lang + "\\MSG\\INDEX.csv";
// strREG7 = strREG7 + "\\" + lang + "\\CHARSET";
// CharsetCD = WshShell.RegRead( strREG7 );
// ifile = SysPath + "\\" + Mut3Sys + "\\MENU\\" + lang + "\\INI\\02MUT3ENV.ini";
// encode = StartObj.Get_Information(ifile,"CODE", CharsetCD, "1252");
// mes = StartObj.Get_Message(mfile,"002",encode);
mes = StartObj.Get_Message(mfile,"002");
WshShell.Popup(mes , 0, "MUT3",16);
}
Pid = 0;
if (flgReg == true )
{
WScript.Sleep(5000);
while ( true )
{
// Check IE and CAESARKICK flag
Pid = StartObj.Get_ProcID(ChkExeName);
Kick = StartObj.Get_Information(vfile,"ENV","CAESARKICK", "0");
if (Pid == 0 && Kick != "1" )
{
WScript.Sleep(2000);
Pid = StartObj.Get_ProcID(ChkExeName);
Kick = StartObj.Get_Information(vfile,"ENV","CAESARKICK", "0");
if (Pid == 0 && Kick != "1" )
{
WshShell.RegWrite( strREG2, valie ,"REG_DWORD" );
WshShell.RegWrite( strREG3, valcd ,"REG_DWORD" );
// 2010/11/03 Modify Start
// TempPath = WshShell.RegRead( strREG5 );
if (num >= 6.0)
TempPath = WshShell.RegRead( strREG8 );
else
TempPath = WshShell.RegRead( strREG5 );
// 2010/11/03 Modify End
tfile = TempPath + "\\TEMP\\IeOptionTB.DAT";
StartObj.Set_Information(tfile,"ENV", "MUT3OFF", "0");
try {
WshShell.RegDelete( strREG4 );
}catch(e){
}
break;
}
}
WScript.Sleep(1000);
}
}
function ChkVer( strVer1, strVer2 )
{
var arrVer1, arrVer2, i;
arrVer1 = strVer1.split(".");
arrVer2 = strVer2.split(".");
for (i=0;i<arrVer1.length && i<arrVer2.length;i++)
{
if (arrVer1[i] > arrVer2[i]) return -1;
if (arrVer1[i] < arrVer2[i]) return 1;
}
return 0;
}
|