' ---------------------------------------------------------- ' Script de restauration des fichiers ' AUTOEXEC.NT et CONFIG.NT ' ' Syntaxe: ' restorauto ' ' ' JC BELLAMY © 2005 ' ---------------------------------------------------------- Const ForReading=1 Const ForWriting=2 Const ForAppending=8 Dim net, shell, user, computer, args, fso Set net = Wscript.CreateObject("WScript.Network") Set shell = WScript.CreateObject("WScript.Shell") Set fso = WScript.CreateObject("Scripting.FileSystemObject") msg= "Restauration des fichiers AUTOXEC.NT et CONFIG.NT" & VBCRLF msg=msg & "JCB © 2005" & VBCRLF msg=msg & "-------------------------------------------------" & VBCRLF Windir=shell.ExpandEnvironmentStrings("%systemroot%") Autoexec = Windir & "\system32\autoexec.nt" Config = Windir & "\system32\config.nt" set ts=fso.OpenTextFile(Config,ForWriting,true) ts.WriteLine("dos=high,umb") ts.WriteLine("device=%SystemRoot%\system32\himem.sys") ts.WriteLine("files=40") ts.Close msg=msg & "Fichier """ & Config & """ restauré" & VBCRLF set ts=fso.OpenTextFile(Autoexec,ForWriting,true) ts.WriteLine("@echo off") ts.WriteLine("lh %SystemRoot%\system32\mscdexnt.exe") ts.WriteLine("lh %SystemRoot%\system32\redir") ts.WriteLine("lh %SystemRoot%\system32\dosx") ts.WriteLine("SET BLASTER=A220 I5 D1 P330 T3") ts.Close msg=msg & "Fichier """ & Autoexec & """ restauré" & VBCRLF wscript.echo msg