Here's my code:
I'm running it under Administrator mode (the account), but I'm getting an access denied, with an UnauthorizedAccessException. The file isn't read only, although It's a system file. Any ideas on how to write to the boot.ini file?
Code:
string drive = "c";
TextReader tr = new StreamReader(String.Format(@"{0}:\boot.ini.zives",drive));
tr.WriteLine("test");
tr.Flush();
tr.Close();
I'm running it under Administrator mode (the account), but I'm getting an access denied, with an UnauthorizedAccessException. The file isn't read only, although It's a system file. Any ideas on how to write to the boot.ini file?