This script starts IE and opens a web site.

Dim IE1
Set IE1 = WScript.CreateObject("InternetExplorer.Application")
IE1.Visible = True
IE1.Navigate
"http://www.microsoft.com/technet/scriptcenter/resources/qanda/hsgarch.mspx"


How can I add this web site to my favorites?

Re: How can I add this web site to my favorites? by Joe

Joe
Mon Mar 10 03:04:25 CDT 2008

"Maxx" <Maxx@Leggs.com> wrote in message
news:OurQNPWgIHA.4076@TK2MSFTNGP05.phx.gbl...
>
> This script starts IE and opens a web site.
>
> Dim IE1
> Set IE1 = WScript.CreateObject("InternetExplorer.Application")
> IE1.Visible = True
> IE1.Navigate
> "http://www.microsoft.com/technet/scriptcenter/resources/qanda/hsgarch.mspx"
>
>
> How can I add this web site to my favorites?
>
>
>
Try searching for the AddFavorite method. Alternatively, if you don't want
the dialogue box to appear then you can create an internet shortcut, it's
only a text file, in the users Favorites folder.

--

Joe Fawcett (MVP - XML)

http://joe.fawcett.name



RE: How can I add this web site to my favorites? by CoreyThomasMCSEMCSAMCDBA

CoreyThomasMCSEMCSAMCDBA
Mon Mar 10 07:53:01 CDT 2008

Hey Maxx,

There isn't an "addFavorite" method in the InternetExplorer.Application
model. However, you can create a shortcut URL fairly easily.

The WshShell object has a CreateShortcut method that you can use to create a
nice .lnk file.

-Corey

"Maxx" wrote:

>
> This script starts IE and opens a web site.
>
> Dim IE1
> Set IE1 = WScript.CreateObject("InternetExplorer.Application")
> IE1.Visible = True
> IE1.Navigate
> "http://www.microsoft.com/technet/scriptcenter/resources/qanda/hsgarch.mspx"
>
>
> How can I add this web site to my favorites?
>
>
>
>

Re: How can I add this web site to my favorites? by Paul

Paul
Mon Mar 10 14:21:05 CDT 2008


"Corey Thomas - MCSE/MCSA/MCDBA"
<CoreyThomasMCSEMCSAMCDBA@discussions.microsoft.com> wrote in message
news:D19DA443-4AAC-4767-9FC5-A597AE638171@microsoft.com...
> Hey Maxx,
>
> There isn't an "addFavorite" method in the
> InternetExplorer.Application
> model. However, you can create a shortcut URL fairly easily.

I think it depends on how you define the InternetExplorer.Application
model; I would call it part of the model. Here is a sample statement:

window.external.AddFavorite(location.href, document.title)

See reference:
http://msdn2.microsoft.com/en-us/library/ms535926(VS.85).aspx

-Paul Randall



Re: How can I add this web site to my favorites? by CoreyThomasMCSEMCSAMCDBA

CoreyThomasMCSEMCSAMCDBA
Mon Mar 10 15:47:03 CDT 2008

Hmmm.. That looks like html based script so I'm not sure how you would
access it via local vbscript. You can't use an HTA either: "This method is
not supported in HTML Applications (HTAs). "

I guess you could create an internetexplorer.application and add the code to
the html code and execute it. But that seems like the long way around.


-Corey


"Paul Randall" wrote:

>
> "Corey Thomas - MCSE/MCSA/MCDBA"
> <CoreyThomasMCSEMCSAMCDBA@discussions.microsoft.com> wrote in message
> news:D19DA443-4AAC-4767-9FC5-A597AE638171@microsoft.com...
> > Hey Maxx,
> >
> > There isn't an "addFavorite" method in the
> > InternetExplorer.Application
> > model. However, you can create a shortcut URL fairly easily.
>
> I think it depends on how you define the InternetExplorer.Application
> model; I would call it part of the model. Here is a sample statement:
>
> window.external.AddFavorite(location.href, document.title)
>
> See reference:
> http://msdn2.microsoft.com/en-us/library/ms535926(VS.85).aspx
>
> -Paul Randall
>
>
>

Re: How can I add this web site to my favorites? by Tom

Tom
Mon Mar 10 15:51:22 CDT 2008

On Mar 10, 8:53 am, Corey Thomas - MCSE/MCSA/MCDBA
<CoreyThomasMCSEMCSAMC...@discussions.microsoft.com> wrote:
> Hey Maxx,
>
> There isn't an "addFavorite" method in the InternetExplorer.Application
> model. However, you can create a shortcut URL fairly easily.
>
> The WshShell object has a CreateShortcut method that you can use to create a
> nice .lnk file.
>
> -Corey
>
> "Maxx" wrote:
>
> > This script starts IE and opens a web site.
>
> > Dim IE1
> > Set IE1 = WScript.CreateObject("InternetExplorer.Application")
> > IE1.Visible = True
> > IE1.Navigate
> > "http://www.microsoft.com/technet/scriptcenter/resources/qanda/hsgarch..."
>
> > How can I add this web site to my favorites?

That reminds me (adapted from WSH documentation example) ...

sTitle = "Microsoft Web Site"
with CreateObject("WScript.Shell")
sFavorites = .SpecialFolders("Favorites")
with .CreateShortcut(sFavorites & "\" & sTitle & ".url")
.TargetPath = "http://www.microsoft.com"
.Save
end with ' shortcut
end with ' shell

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/

Re: How can I add this web site to my favorites? by mayayana

mayayana
Mon Mar 10 17:41:04 CDT 2008

> Hmmm.. That looks like html based script so I'm not sure how you would
> access it via local vbscript. You can't use an HTA either: "This method
is
> not supported in HTML Applications (HTAs). "
>
> I guess you could create an internetexplorer.application and add the code
to
> the html code and execute it. But that seems like the long way around.
>

He's already created an IE application. All he
needs is to reference the IE1.document.parentWindow

The docs seem to say, though, that AddFavorite
shows a dialogue. So it requires interaction.



Re: How can I add this web site to my favorites? by Maxx

Maxx
Tue Mar 11 05:53:06 CDT 2008

Tom that script works beautifully - thansk for your help.

Maxx



"Tom Lavedas" <tglbatch@cox.net> wrote in message
news:fff722f5-959b-40eb-a0b2-bfa9b7e7f8b7@m34g2000hsc.googlegroups.com...
> On Mar 10, 8:53 am, Corey Thomas - MCSE/MCSA/MCDBA
> <CoreyThomasMCSEMCSAMC...@discussions.microsoft.com> wrote:
>> Hey Maxx,
>>
>> There isn't an "addFavorite" method in the InternetExplorer.Application
>> model. However, you can create a shortcut URL fairly easily.
>>
>> The WshShell object has a CreateShortcut method that you can use to
>> create a
>> nice .lnk file.
>>
>> -Corey
>>
>> "Maxx" wrote:
>>
>> > This script starts IE and opens a web site.
>>
>> > Dim IE1
>> > Set IE1 = WScript.CreateObject("InternetExplorer.Application")
>> > IE1.Visible = True
>> > IE1.Navigate
>> > "http://www.microsoft.com/technet/scriptcenter/resources/qanda/hsgarch..."
>>
>> > How can I add this web site to my favorites?
>
> That reminds me (adapted from WSH documentation example) ...
>
> sTitle = "Microsoft Web Site"
> with CreateObject("WScript.Shell")
> sFavorites = .SpecialFolders("Favorites")
> with .CreateShortcut(sFavorites & "\" & sTitle & ".url")
> .TargetPath = "http://www.microsoft.com"
> .Save
> end with ' shortcut
> end with ' shell
>
> Tom Lavedas
> ===========
> http://members.cox.net/tglbatch/wsh/



Re: How can I add this web site to my favorites? by CoreyThomasMCSEMCSAMCDBA

CoreyThomasMCSEMCSAMCDBA
Tue Mar 11 08:22:03 CDT 2008

Adding a website to the IE favorites:

http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true



"mayayana" wrote:

> > Hmmm.. That looks like html based script so I'm not sure how you would
> > access it via local vbscript. You can't use an HTA either: "This method
> is
> > not supported in HTML Applications (HTAs). "
> >
> > I guess you could create an internetexplorer.application and add the code
> to
> > the html code and execute it. But that seems like the long way around.
> >
>
> He's already created an IE application. All he
> needs is to reference the IE1.document.parentWindow
>
> The docs seem to say, though, that AddFavorite
> shows a dialogue. So it requires interaction.
>
>
>