I am trying to change .url file generated by IE as a favorite file. I have the following code in C#:
string[] lines = File.ReadAllLines(filename);
lines[1] = "URL=javascript:{alert('this is a test');void(0);}";
File.WriteAllLines(filename, lines);
The .url file opened in Notepad looks like this (the code is of a bookmarklet that will change over and over):
[InternetShortcut]
URL=javascript:{alert('this is a test');void(0);}
The problem is IE does not see get the changes until it is closed and re-opened. How do I make it, reload the new URL?