'------------------------------------------------ 'Author: CreatoR 'Creation Date/Time: 27.02.2008 'Description: Copy From Ru-Board Installer to IE '------------------------------------------------ On Error Resume Next Set WshShell = WScript.CreateObject("WScript.Shell") Set oFS = CreateObject("Scripting.FileSystemObject") Ask = MsgBox("Установить модуль для *корректного* копирования с ?", 262144+36, "Вопрос") If Ask <> 6 Then Wscript.Quit 0 Old_ItemName = WshShell.RegRead("HKCU\Software\Copy_From_Ru-Board\Item Name") If Old_ItemName = "" Then Old_ItemName = "Копировать с Ru-Board" ItemName = Old_ItemName Input_ItemName = InputBox("Введите имя пункта для контекстного меню в Internet Explorer", _ "Ввод имени пункта", ItemName) If Input_ItemName = "" Then Wscript.Quit 0 '"Запоминаем" введённое имя пункта и удаляем старые записи ItemName = Input_ItemName WshShell.RegWrite "HKCU\Software\Copy_From_Ru-Board\Item Name", ItemName, "REG_SZ" WshShell.RegDelete "HKCU\Software\Microsoft\Internet Explorer\MenuExt\" & Old_ItemName & "\" IEPath = WshShell.ExpandEnvironmentStrings("%programfiles%") & "\Internet Explorer\PLUGINS" HtmPath = IEPath & "\CopyFrom_forum.ru-board.htm" If Not oFS.FolderExists(IEPath) Then MsgBox "Не удалось определить путь к Internet Explorer." & VBCRLF & VBCRLF & _ "[" & IEPath & "]" & VBCRLF & VBCRLF & _ "OK ---> EXIT", 262144+16, "Ошибка" Wscript.Quit 0 End If 'Пишем в htm файл код для получения выделенного текста в IE HtmContent = "" & VBCRLF If Not oFS.FileExists(HtmPath) Then oFS.CreateTextFile HtmPath, True Set fOpen = oFS.OpenTextFile(HtmPath, 2) fOpen.Write HtmContent fOpen.Close 'Пишем в реестр данные для контекстного меню IExplore. WshShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\MenuExt\" & ItemName & "\contexts", 51, "REG_DWORD" WshShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\MenuExt\" & ItemName & "\", HtmPath, "REG_SZ" MsgBox "Модуль *корректного* копирования с был успешно установлен! :)", _ 262144+64, "Завершение..."