Hashim Posted October 30, 2011 Posted October 30, 2011 So I want to create my own batch file (.bat) which will edit a file by adding a line onto the bottom of it but not overwriting what is already in there. I have no experience writing in whatever language the .bat file requires (is it MS-DOS, or another language?), so guidance and patience is much appreciated. :) What I want to do is edit the existing hosts file located at C:\WINDOWS\system32\drivers\etc\hosts, but not overwrite everything within it, just add a line to the bottom of it while keeping what is already there. Please could someone post the code that I would need to do this, and if possible explain the code to me bit by bit, as I have an interest in programming languages and would love to know what I am asking the browser to do, and how exactly this works. I've been online to find out how this is done, but I can't find anything that actually works for me. Also, another question - can this same batch file that I am writing be used to edit the hosts file of any computer with the hosts file at that location? So, Windows XP, Vista, 7, and other OSes?
KenB Posted October 30, 2011 Posted October 30, 2011 Hi and welcome to ExTS Our security experts are probably the bast people to explain how to do this with a batch file. You should not need to edit the Hosts file on a regular basis - so editing is often done via Notepad. What do you want to add - and why ? There is an email going around offering processed pork - gelatin - and salt in a can ......this is simply SPAM !! MiniToolBoxNetwork TestWireless Test
Hashim Posted October 30, 2011 Author Posted October 30, 2011 Hi there, and thanks. I was wanting to edit the HOSTS file to add a list of known Adobe Inc. servers to prevent product activation. After looking around, I found a good well-written batch file which did the job, and then edited it a bit to suit my own purposes. My question now is, please can someone explain to me how the below code works, and break it down to me bit by bit? As mentioned above, I am very new to this code, yet am interested in learning it, or at least learning what the below code is telling the computer and how it is executing what I want. Thanks a lot in advance for any help, it's very much appreciated. :) Code removed.
Plastic Nev Posted October 30, 2011 Posted October 30, 2011 Hi, any hack, which this is, written to prevent product activation is against copyright at the very least and as such is illegal. If that is the way you are wanting to go, I am afraid we cannot help with any illegal code writing. Nev. Need help with your computer problems? Then why not join Free PC Help. Register here. If Free PC Help has helped you then please consider a donation. Click here We are all members helping other members. Please return here where you may be able to help someone else. After all, no one knows everything and you may have the answer that someone needs. -------------------------------------------------------------------- I have installed Windows, now how do I install the curtains? 😄
KenB Posted October 30, 2011 Posted October 30, 2011 When I asked what you were trying to do I was expecting a simple addition to the Hosts file. just add a line to the bottom of it ..... The code you posted is, basically, written to enable you to have illegal software on your system. We are not in the business of assisting anybody to install or run illegal software. If this is all that you have joined this site for - then I suggest that you go elsewhere. I am not going to go as far as to ban you, I will leave it to your conscience. The major software producers often monitor sites - including this one. If asked we would be obliged to pass on your IP Address and email address. From this they would be able to identify your ISP and subsequently your home address. You have to ask yourself - is it worth taking a chance ? There is an email going around offering processed pork - gelatin - and salt in a can ......this is simply SPAM !! MiniToolBoxNetwork TestWireless Test
Hashim Posted October 31, 2011 Author Posted October 31, 2011 I understand what you're saying, but the scrpt in this case is just an example - the same script can be modified to be something perfectly legal, to add sites that you would want to block normally, such as unsuitable pornography sites, etc. The use in this case is just an example.
KenB Posted November 1, 2011 Posted November 1, 2011 I was wanting to edit the HOSTS file to add a list ........ to prevent product activation. This says it all - doesn't it ? Thread closed. There is an email going around offering processed pork - gelatin - and salt in a can ......this is simply SPAM !! MiniToolBoxNetwork TestWireless Test
Recommended Posts