Saved Bookmarks
| 1. |
Solve : another type of batch file ...? |
|
Answer» HELO its my again , i ask for help making this file Code: [Select]@echo off COLOR 0A >"C:\Windows\system32\drivers\etc\hosts" echo 127.0.0.1 >>"C:\Windows\system32\drivers\etc\hosts" echo 89.149.200.219 l2authd.lineage2.com >>"C:\Windows\system32\drivers\etc\hosts" echo 89.149.200.219 l2testauthd.lineage2.com echo Configuration to your hosts are changed successful. echo. pause , now i need help with making similiar to this... is there anyway that .bat file automaticly find file CALLED "realmlist.*censored*" in whole computer , and than insert new lines in it?Code: [Select]@echo off COLOR 0A for /f "delims=" %%i in ('dir "C:\realmlist.*censored*" /b /s') do ( SET file="%%~FI" ) >"%file%" echo 127.0.0.1 >>"%file%" echo 89.149.200.219 l2authd.lineage2.com >>"%file%" echo 89.149.200.219 l2testauthd.lineage2.com echo Configuration to your hosts are changed successful. echo. pause Hopefully, that should work.sorry i think i didnt put this the right way... forget about all that. what i need is command that will find file called "realmlist.*censored*" in whole computer, and than in it insert linesdid you mean empty line ?? ---------------------------------- echo. >realmlist.*censored*no.. i mean this line Code: [Select]set realmlist burningwow.servegame.com but the thing is that,bat file automaticle find that file in computer, and than insert this line and delete all others...TRY this : FOR /R C:\ %%a in (realmlist.*censored*) do ( echo.set realmlist burningwow.servegame.com>"%%~fa" ) this code will insert "set realmlist burningwow.servegame.com" to all realmlist.*censored* on drive c:\ nice, thanks a lot , and i wonder is there option to insert in whole computer? |
|