how to edit hosts file in windows7 using java program ?
kumar prathi
Greenhorn
Joined: Nov 14, 2011
Posts: 17
posted
0
Hi all,
How to edit the hosts file of windows7 using java program .
Any one please help me regarding this.
Tim Moores
Rancher
Joined: Sep 21, 2011
Posts: 2407
posted
1
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)?
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.
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?