How do I change startpage on my browser Internet Explorer, with a code?
Printable View
How do I change startpage on my browser Internet Explorer, with a code?
1. Tools->Internet Options->General ......the first textbox
or did I mis-read the question?
You find the start page in the Windows Registry (Windows 98 machine) -- in
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
Set the Start Page key's value to "www.yahoo.com" or whatever you want to start with.
Notice that the above affects the current user. You can also set it for default users in
HKEY_USERS\.DEFAULT\Software\Microsoft\Internet Explorer\Main
Depending on your operating systems and whether or not you have user profiles etc. etc. you may need to modify different keys. Read up on the Windows registry (if there is any such info anywhere), moneky areound with it, but please make a backup copy before you begin -- just in case.
ANYWAY -- to write to the key in code, either use the Windows API functions (they are documented countless times on this site). OR, create a text file called MyIEStartPage.reg and put the following into it:
Then use the ShellExecute API call to "double click" your REG file from within VB code. This will "merge" the data above into the registry and overwrite whatever value is there beforehand. THEREFORE, make a backup copy of that reg-key, so you can undo your action later.Code:REGEDIT4
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Start Page"="http://www.yahoo.com/"
Again, the ShellExecute function is explained numerous times on this site, so search for it, and though shall find.
Hope I am pointing you in the right direction(s). Just suggesting two different ways.
and if you do it w/ the reg file, you can use basic file handling to create that file dynamically, then you can use the kill statement to delete it when your done...
AND restore the user's previous value IF so desired. BACKUP COPY remember?
or, you could always use api to get the setting, write it to a reg file, and give the user an option to use their old value and just shellexecute to the reg file created w/ the original in it...