PC Review


Reply
Thread Tools Rate Thread

Batch file help

 
 
shallowz
Guest
Posts: n/a
 
      7th Jan 2009
To let know you I know very little about batch files
But I know a batch file will help in this situation
This is what I want to do

I want to be able to add
192.10.11.48 www.website.com
To the end of the hosts file in system 32

I want to do this to a couple of computers and I can’t replace the hosts
file so I need to add “192.10.11.48 www.website.com” to the end of the page

What are the codes I need to add to a patch file to do this?

 
Reply With Quote
 
 
 
 
Big_Al
Guest
Posts: n/a
 
      7th Jan 2009
shallowz said this on 1/7/2009 1:45 PM:
> To let know you I know very little about batch files
> But I know a batch file will help in this situation
> This is what I want to do
>
> I want to be able to add
> 192.10.11.48 www.website.com
> To the end of the hosts file in system 32
>
> I want to do this to a couple of computers and I can’t replace the hosts
> file so I need to add “192.10.11.48 www.website.com” to the end of the page
>
> What are the codes I need to add to a patch file to do this?
>


echo "192.10.11.48 www.website.com" >> %windir%\system32\drivers\etc\hosts


Thats all on one line if wordwrap kicks in.
 
Reply With Quote
 
shallowz
Guest
Posts: n/a
 
      7th Jan 2009
that is the answer i was looking for and it worked
thank you very much for your help

"Big_Al" wrote:

> shallowz said this on 1/7/2009 1:45 PM:
> > To let know you I know very little about batch files
> > But I know a batch file will help in this situation
> > This is what I want to do
> >
> > I want to be able to add
> > 192.10.11.48 www.website.com
> > To the end of the hosts file in system 32
> >
> > I want to do this to a couple of computers and I can’t replace the hosts
> > file so I need to add “192.10.11.48 www.website.com” to the end of the page
> >
> > What are the codes I need to add to a patch file to do this?
> >

>
> echo "192.10.11.48 www.website.com" >> %windir%\system32\drivers\etc\hosts
>
>
> Thats all on one line if wordwrap kicks in.
>

 
Reply With Quote
 
Stan Brown
Guest
Posts: n/a
 
      8th Jan 2009
Wed, 07 Jan 2009 14:39:10 -0500 from Big_Al <(E-Mail Removed)>:
> shallowz said this on 1/7/2009 1:45 PM:
> > I want to be able to add
> > 192.10.11.48 www.website.com
> > To the end of the hosts file in system 32

>
> echo "192.10.11.48 www.website.com" >> %windir%\system32\drivers\etc\hosts


Only if you actually want the quotes in the hosts file, and I don't
think you do.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com
Shikata ga nai...
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A script/batch to kill a batch file from scheduled tasks? Bogdan Windows XP Configuration 1 31st Jul 2009 06:05 AM
batch file call from a macro - how ? and required batch format VB-rookie Microsoft Excel Programming 3 5th Sep 2008 10:33 PM
calling multiple batch files from within a batch file yawnmoth Windows XP General 3 26th May 2008 06:47 PM
Batch file works in command line but not as a batch Danger Windows XP General 7 5th Feb 2008 04:50 PM
Save batch window msgs to a file from the batch prog Stephen Rainey Windows XP General 3 10th Jan 2007 12:50 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:30 AM.