Go Back   AnandTech Forums > Software > Operating Systems

Forums
· Hardware and Technology
· CPUs and Overclocking
· Motherboards
· Video Cards and Graphics
· Memory and Storage
· Power Supplies
· Cases & Cooling
· SFF, Notebooks, Pre-Built/Barebones PCs
· Networking
· Peripherals
· General Hardware
· Highly Technical
· Computer Help
· Home Theater PCs
· Consumer Electronics
· Digital and Video Cameras
· Mobile Devices & Gadgets
· Audio/Video & Home Theater
· Software
· Software for Windows
· All Things Apple
· *nix Software
· Operating Systems
· Programming
· PC Gaming
· Console Gaming
· Distributed Computing
· Security
· Social
· Off Topic
· Politics and News
· Discussion Club
· Love and Relationships
· The Garage
· Health and Fitness
· Merchandise and Shopping
· For Sale/Trade
· Hot Deals
· Free Stuff
· Contests and Sweepstakes
· Black Friday 2012
· Forum Issues
· Technical Forum Issues
· Personal Forum Issues
· Suggestion Box
· Moderator Resources
· Moderator Discussions
   

Reply
 
Thread Tools
Old 09-03-2012, 03:31 PM   #1
JEDI
Lifer
 
JEDI's Avatar
 
Join Date: Sep 2001
Location: Somewhere between hare . . . . . & their
Posts: 17,537
Default Win7: Change Host file from Dos window?

my host file has ad blockers but sometimes i need to temporarily disable it to get cashback from ordering from websites.

in WinXP, i had a simple .bat to rename the host file. then another simple .bat file to name it back.

but in Win7 it says Access is denied.

I am logged in as Admin.
i had to open Windows Explorer and click directories all the way down to get to the Host file in drivers/etc.

how can i make my .bat file work in Win7?
__________________
Quote:
Irony: The new Virgin Mary aborted the 2nd coming of Christ in 2000
Degree: Masters in Viagra (Summa Cum Loude), Job: Porn Star, Salary: YEAH, BABY!
Also has BS in Asian Massage studies
You know you're boring when God falls asleep on you
JEDI is online now   Reply With Quote
Old 09-03-2012, 04:31 PM   #2
postmortemIA
Diamond Member
 
postmortemIA's Avatar
 
Join Date: Jul 2006
Location: Midwest USA
Posts: 5,701
Default

run it as administrator?
__________________
i7-3770, Intel DZ77SL-50K, VisionTek HD 7850, Dell 2707WFP, X25-M, X-Fi * PC Gamer Since 1991 *
postmortemIA is offline   Reply With Quote
Old 09-03-2012, 05:20 PM   #3
Nothinman
Elite Member
 
Nothinman's Avatar
 
Join Date: Sep 2001
Posts: 30,636
Default

Use a better browser with an ad-block extension that can be easily toggled on and off?
__________________
http://www.debian.org
Nothinman is offline   Reply With Quote
Old 09-03-2012, 07:20 PM   #4
hhhd1
Senior Member
 
Join Date: Apr 2012
Posts: 405
Default

haven't tried it, but give is a go:

give "everyone" permission on the file to "full control"

Edit,

ofc, the file that needs the permission modified is the hosts file, and not the bat file.
hhhd1 is offline   Reply With Quote
Old 09-03-2012, 07:36 PM   #5
Nothinman
Elite Member
 
Nothinman's Avatar
 
Join Date: Sep 2001
Posts: 30,636
Default

Quote:
Originally Posted by hhhd1 View Post
haven't tried it, but give is a go:

give "everyone" permission on the file to "full control"

Edit,

ofc, the file that needs the permission modified is the hosts file, and not the bat file.
Since he's doing renames the object that needs permission is the parent directory, not the file itself.
__________________
http://www.debian.org
Nothinman is offline   Reply With Quote
Old 09-03-2012, 07:39 PM   #6
theevilsharpie
Platinum Member
 
Join Date: Nov 2009
Location: Southern California
Posts: 2,138
Default

Quote:
Originally Posted by JEDI View Post
how can i make my .bat file work in Win7?
Right-click on it and run as Administrator. Alternatively, you should be able to set a compatibility flag in the .bat file's properties that will automatically request privilege elevation.

Quote:
Originally Posted by hhhd1 View Post
haven't tried it, but give is a go:

give "everyone" permission on the file to "full control"

Edit,

ofc, the file that needs the permission modified is the hosts file, and not the bat file.
Please don't do this.
theevilsharpie is offline   Reply With Quote
Old 09-04-2012, 01:40 PM   #7
cl-scott
ASUS Support
 
Join Date: Jul 2012
Posts: 457
Default

Quote:
Originally Posted by Nothinman View Post
Use a better browser with an ad-block extension that can be easily toggled on and off?
I have to agree. The HOSTS file is kind of a poor man's DNS, and it's an extremely clumsy and ineffectual tool for blocking ads. On an Android device you can at least argue that it is very battery friendly, but on a computer capable of running Windows you don't even have that somewhat flimsy excuse.
cl-scott is offline   Reply With Quote
Old 09-04-2012, 04:07 PM   #8
JEDI
Lifer
 
JEDI's Avatar
 
Join Date: Sep 2001
Location: Somewhere between hare . . . . . & their
Posts: 17,537
Default

Quote:
Originally Posted by Nothinman View Post
Use a better browser with an ad-block extension that can be easily toggled on and off?
which broswer? chrome?
__________________
Quote:
Irony: The new Virgin Mary aborted the 2nd coming of Christ in 2000
Degree: Masters in Viagra (Summa Cum Loude), Job: Porn Star, Salary: YEAH, BABY!
Also has BS in Asian Massage studies
You know you're boring when God falls asleep on you
JEDI is online now   Reply With Quote
Old 09-04-2012, 05:46 PM   #9
cl-scott
ASUS Support
 
Join Date: Jul 2012
Posts: 457
Default

Quote:
Originally Posted by JEDI View Post
which broswer? chrome?
Firefox and Adblock Plus is the best solution from a technical standpoint. The Gecko rendering engine can literally be interrupted by extensions, so AdBlock Plus can literally prevent the browser from even downloading ads. The extension can also alter the layout of the page, to let you reclaim the space used by the ads. So they aren't just hidden, it's as if they never even existed.

Chrome has a version of AdBlock Plus, but it's rather neutered in comparison because extensions cannot interact with the rendering engine in the same way they can on Firefox. Generally the page is downloaded, rendered, and then filtered through the extension. So you might see the page with ads, then it flashes and reloads without the ads. Supposedly Google was very interested in having a version of NoScript for Chrome way back when, but so far Google hasn't really made any serious efforts to add the needed functionality. The same basic functionality needed for AdBlock Plus to work most efficiently.
cl-scott is offline   Reply With Quote
Old 09-04-2012, 07:55 PM   #10
Nothinman
Elite Member
 
Nothinman's Avatar
 
Join Date: Sep 2001
Posts: 30,636
Default

Quote:
Originally Posted by JEDI View Post
which broswer? chrome?
I personally use Chrome with Ad-block simply because I like it better. But the issues that cl-scott mention are something you should consider. Where the FF extension will block the entire request to an ad, Chrome's Ad-block will download and remove it after the fact.
__________________
http://www.debian.org
Nothinman is offline   Reply With Quote
Reply

Thread Tools

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

Forum Jump


All times are GMT -5. The time now is 05:40 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.