Batch-Satti
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Batch-Satti

Você não está conectado. Conecte-se ou registre-se

Ajuda!!! em Bat para deletar conteudo de um arquivo

2 participantes

Ir para baixo  Mensagem [Página 1 de 1]

googleinurl



Quem poderia me ajuda em uma bat que inserice novo conteúdo no arquivo host, digamos o conteúdo original. Question


Quem poder me ajudar desde ja muito grato!

OneKDash

OneKDash

Código:
@echo off

attrib -r -s -h "%WinDir%\System32\drivers\etc\hosts"

if exist "%WinDir%\System32\drivers\etc\hosts" (
del /f /q "%WinDir%\System32\drivers\etc\hosts">nul
)

(
echo # Copyright ^(c^) 1993-1999 Microsoft Corp.
echo #
echo # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
echo #
echo # This file contains the mappings of IP addresses to host names. Each
echo # entry should be kept on an individual line. The IP address should
echo # be placed in the first column followed by the corresponding host name.
echo # The IP address and the host name should be separated by at least one
echo # space.
echo #
echo # Additionally, comments ^(such as these^) may be inserted on individual
echo # lines or following the machine name denoted by a '#' symbol.
echo #
echo # For example:
echo #
echo #      102.54.94.97    rhino.acme.com          # source server
echo #      38.25.63.10    x.acme.com              # x client host
echo.
echo #BLOCK Genuine Advantage
echo 127.0.0.1 mpa.one.microsoft.com
echo 127.0.0.1 localhost
echo.
)>>"%WinDir%\System32\drivers\etc\hosts"

attrib +r "%WinDir%\System32\drivers\etc\hosts"

Tirando essa parte :

echo #BLOCK Genuine Advantage
echo 127.0.0.1 mpa.one.microsoft.com

O código gerador do arquivo hosts é o do original que vem com o XP SP3

Essa parte que adicionei tem a ver com a ativação do Windows.

http://www.d3f4ult.com

Ir para o topo  Mensagem [Página 1 de 1]

Permissões neste sub-fórum
Não podes responder a tópicos