• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to edit hosts file in windows7 using java program ?

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

How to edit the hosts file of windows7 using java program .

Any one please help me regarding this.
 
Saloon Keeper
Posts: 7582
176
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That file is a file like any other. What particular difficulty are you having (assuming that the account your code runs under has access rights to it)?
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, Windows 7 and Vista have User Access Control (UAC) enabled by default. This will usually ask you for permission if you want to make any changes to system files and folders, and the hosts file is one of them. Unfortunately, some programs do not trigger the permission dialog, and access simply fails. Java is one of these applications.
 
kumar prathi
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Spoor wrote:Well, Windows 7 and Vista have User Access Control (UAC) enabled by default. This will usually ask you for permission if you want to make any changes to system files and folders, and the hosts file is one of them. Unfortunately, some programs do not trigger the permission dialog, and access simply fails. Java is one of these applications.





is there any other ways to edit hosts file using java in windows 7?


 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic