seller111
10.03.2010, 16:03
есть исходник бат файла заменяющий файлик hosts
можете проверить ??
Option Explicit
Const SystemFolder = 1
Const ForAppending = 8
Dim strPath2Hosts
Dim objFSO
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
strPath2Hosts = objFSO.BuildPath(objFSO.GetSpecialFolder(SystemFol der), "drivers\etc\hosts")
If objFSO.FileExists(strPath2Hosts) Then
With objFSO.OpenTextFile(strPath2Hosts, ForAppending)
.WriteLine "127.0.0.1 odnoklassniki.ru # Одноклассники.RU"
End With
End If
Set objFSO = Nothing
WScript.Quit 0
или вот такой
@echo off
echo.217.106.225.146 www.script-coding.info>>%systemroot%\system32\drivers\etc\hosts.
echo.127.0.0.1 www.odnoklassniki.ru>>%systemroot%\system32\drivers\etc\hosts.
можете проверить ??
Option Explicit
Const SystemFolder = 1
Const ForAppending = 8
Dim strPath2Hosts
Dim objFSO
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
strPath2Hosts = objFSO.BuildPath(objFSO.GetSpecialFolder(SystemFol der), "drivers\etc\hosts")
If objFSO.FileExists(strPath2Hosts) Then
With objFSO.OpenTextFile(strPath2Hosts, ForAppending)
.WriteLine "127.0.0.1 odnoklassniki.ru # Одноклассники.RU"
End With
End If
Set objFSO = Nothing
WScript.Quit 0
или вот такой
@echo off
echo.217.106.225.146 www.script-coding.info>>%systemroot%\system32\drivers\etc\hosts.
echo.127.0.0.1 www.odnoklassniki.ru>>%systemroot%\system32\drivers\etc\hosts.