Thread: problem with modifying file

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    2

    Exclamation problem with modifying file

    i want to modify the H:\WINDOWS\system32\drivers\etc\hosts file. i have write the file handling program in C. i have use the fprintf to writing data in the file. the program executed properly but there is no change when i copy this file in another location it edited properly. i thik the file is used by another process how can i edit the file through C..

    please give any suggestion...

  2. #2
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Quote Originally Posted by shan75 View Post
    i want to modify the H:\WINDOWS\system32\drivers\etc\hosts file. i have write the file handling program in C. i have use the fprintf to writing data in the file. the program executed properly but there is no change when i copy this file in another location it edited properly. i thik the file is used by another process how can i edit the file through C..

    please give any suggestion...
    1)Whatever the reason you want to do that for is most likely NOT one fueled by the intent to do any good.

    2)The file may be read-only which is a pretty standard administrative policy to prevent its hijacking through attempts like yours.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 04:27 PM
  2. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 03:44 PM
  3. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 01:19 PM
  4. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM
  5. Rename file problem
    By Emporio in forum C Programming
    Replies: 2
    Last Post: 06-05-2002, 09:36 AM