Automatic Edit File

  • Thread starter Thread starter Randy Magargle
  • Start date Start date
R

Randy Magargle

I am looking for some information about editing a file
through a script file. What I want to do is the sysco.inf
file in windows, I need to automatically remove the word
hide in text.
 
I am looking for some information about editing a file
through a script file. What I want to do is the sysco.inf
file in windows, I need to automatically remove the word
hide in text.

@echo off
setlocal
copy %SystemRoot%\INF\sysoc.inf "%TEMP%\sysoc.inf"
del /q %SystemRoot%\INF\sysoc.inf
for /f "Tokens=*" %%a in ('type "%TEMP%\sysoc.inf"') DO (
set line=%%a
call :unhide
)
endlocal
goto :EOF
:unhide
set line=%line:,hide=,%
@echo %line%>>%SystemRoot%\INF\sysoc.inf



Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top