public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* open IE from command line
@ 2016-12-20 16:15 Nellis, Kenneth
  2016-12-20 17:20 ` Lee
  2016-12-21  7:30 ` Brian Inglis
  0 siblings, 2 replies; 20+ messages in thread
From: Nellis, Kenneth @ 2016-12-20 16:15 UTC (permalink / raw)
  To: cygwin

How to open a web page (remote or local) or launch IE from the mintty/bash command line?

I've tried the following:

$ cygstart "http://www.google.com"
$ cygstart index.html # local page
$ "/cygdrive/c/Program Files/Internet Explorer/iexplore.exe"
$ cygstart "/cygdrive/c/Program Files/Internet Explorer/iexplore.exe"

If IE is already open, the first two examples work, but otherwise,
for all 4, IE flashes a window, which immediately closes.

--Ken Nellis

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: open IE from command line
  2016-12-20 16:15 open IE from command line Nellis, Kenneth
@ 2016-12-20 17:20 ` Lee
  2016-12-20 22:10   ` cyg Simple
                     ` (2 more replies)
  2016-12-21  7:30 ` Brian Inglis
  1 sibling, 3 replies; 20+ messages in thread
From: Lee @ 2016-12-20 17:20 UTC (permalink / raw)
  To: cygwin

On 12/20/16, Nellis, Kenneth wrote:
> How to open a web page (remote or local) or launch IE from the mintty/bash
> command line?
>
> I've tried the following:
>
> $ cygstart "http://www.google.com"
> $ cygstart index.html # local page
> $ "/cygdrive/c/Program Files/Internet Explorer/iexplore.exe"
> $ cygstart "/cygdrive/c/Program Files/Internet Explorer/iexplore.exe"
>
> If IE is already open, the first two examples work, but otherwise,
> for all 4, IE flashes a window, which immediately closes.

how about
cmd /c "C:\Program Files\Internet Explorer\iexplore.exe"  "www.google.com"

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: open IE from command line
  2016-12-20 17:20 ` Lee
@ 2016-12-20 22:10   ` cyg Simple
  2016-12-20 22:51   ` Andrey Repin
  2016-12-21 14:11   ` Nellis, Kenneth
  2 siblings, 0 replies; 20+ messages in thread
From: cyg Simple @ 2016-12-20 22:10 UTC (permalink / raw)
  To: cygwin

On 12/20/2016 12:20 PM, Lee wrote:
> On 12/20/16, Nellis, Kenneth wrote:
>> How to open a web page (remote or local) or launch IE from the mintty/bash
>> command line?
>>
>> I've tried the following:
>>
>> $ cygstart "http://www.google.com"
>> $ cygstart index.html # local page
>> $ "/cygdrive/c/Program Files/Internet Explorer/iexplore.exe"
>> $ cygstart "/cygdrive/c/Program Files/Internet Explorer/iexplore.exe"
>>
>> If IE is already open, the first two examples work, but otherwise,
>> for all 4, IE flashes a window, which immediately closes.
> 
> how about
> cmd /c "C:\Program Files\Internet Explorer\iexplore.exe"  "www.google.com"
> 

Or you can get by with
$ cmd /c start http://www.google.com

-- 
cyg Simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: open IE from command line
  2016-12-20 17:20 ` Lee
  2016-12-20 22:10   ` cyg Simple
@ 2016-12-20 22:51   ` Andrey Repin
  2016-12-20 23:32     ` Eliot Moss
  2016-12-21 14:11   ` Nellis, Kenneth
  2 siblings, 1 reply; 20+ messages in thread
From: Andrey Repin @ 2016-12-20 22:51 UTC (permalink / raw)
  To: Lee, cygwin

Greetings, Lee!

>> How to open a web page (remote or local) or launch IE from the mintty/bash
>> command line?
>>
>> I've tried the following:
>>
>> $ cygstart "http://www.google.com"
>> $ cygstart index.html # local page
>> $ "/cygdrive/c/Program Files/Internet Explorer/iexplore.exe"
>> $ cygstart "/cygdrive/c/Program Files/Internet Explorer/iexplore.exe"
>>
>> If IE is already open, the first two examples work, but otherwise,
>> for all 4, IE flashes a window, which immediately closes.

> how about
> cmd /c "C:\Program Files\Internet Explorer\iexplore.exe"  "www.google.com"

I'd say,

cmd /c start "" https://google.com/


-- 
With best regards,
Andrey Repin
Wednesday, December 21, 2016 01:37:51

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: open IE from command line
  2016-12-20 22:51   ` Andrey Repin
@ 2016-12-20 23:32     ` Eliot Moss
  2016-12-21  0:50       ` Lee
  0 siblings, 1 reply; 20+ messages in thread
From: Eliot Moss @ 2016-12-20 23:32 UTC (permalink / raw)
  To: cygwin

On 12/20/2016 5:38 PM, Andrey Repin wrote:
> Greetings, Lee!
>
>>> How to open a web page (remote or local) or launch IE from the mintty/bash
>>> command line?
>>>
>>> I've tried the following:
>>>
>>> $ cygstart "http://www.google.com"
>>> $ cygstart index.html # local page
>>> $ "/cygdrive/c/Program Files/Internet Explorer/iexplore.exe"
>>> $ cygstart "/cygdrive/c/Program Files/Internet Explorer/iexplore.exe"
>>>
>>> If IE is already open, the first two examples work, but otherwise,
>>> for all 4, IE flashes a window, which immediately closes.
>
>> how about
>> cmd /c "C:\Program Files\Internet Explorer\iexplore.exe"  "www.google.com"
>
> I'd say,
>
> cmd /c start "" https://google.com/

Both seem to start the *default* browser, in my case, Firefox.
You need to be explicit if you want IE and it's not your default.

Regards -- Eliot Moss

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: open IE from command line
  2016-12-20 23:32     ` Eliot Moss
@ 2016-12-21  0:50       ` Lee
  0 siblings, 0 replies; 20+ messages in thread
From: Lee @ 2016-12-21  0:50 UTC (permalink / raw)
  To: moss, cygwin

On 12/20/16, Eliot Moss wrote:
> On 12/20/2016 5:38 PM, Andrey Repin wrote:
>> Greetings, Lee!
>>
>>>> How to open a web page (remote or local) or launch IE from the
>>>> mintty/bash
>>>> command line?
>>>>
>>>> I've tried the following:
>>>>
>>>> $ cygstart "http://www.google.com"
>>>> $ cygstart index.html # local page
>>>> $ "/cygdrive/c/Program Files/Internet Explorer/iexplore.exe"
>>>> $ cygstart "/cygdrive/c/Program Files/Internet Explorer/iexplore.exe"
>>>>
>>>> If IE is already open, the first two examples work, but otherwise,
>>>> for all 4, IE flashes a window, which immediately closes.
>>
>>> how about
>>> cmd /c "C:\Program Files\Internet Explorer\iexplore.exe"
>>> "www.google.com"
>>
>> I'd say,
>>
>> cmd /c start "" https://google.com/
>
> Both seem to start the *default* browser, in my case, Firefox.
> You need to be explicit if you want IE and it's not your default.

I don't have IE as the default browser & at least for me:

cmd /c start "" https://google.com/
  starts the default browser & opens google.com

cmd /c "C:\Program Files\Internet Explorer\iexplore.exe"  "www.google.com"
  starts the 64 bit version of IE & opens www.google.com

cmd /c "C:\Program Files (x86)\Internet Explorer\iexplore.exe"  "www.google.com"
  starts the 32 bit version of IE & opens www.google.com

Regards,
Lee

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: open IE from command line
  2016-12-20 16:15 open IE from command line Nellis, Kenneth
  2016-12-20 17:20 ` Lee
@ 2016-12-21  7:30 ` Brian Inglis
  1 sibling, 0 replies; 20+ messages in thread
From: Brian Inglis @ 2016-12-21  7:30 UTC (permalink / raw)
  To: cygwin

On 2016-12-20 09:15, Nellis, Kenneth wrote:
> How to open a web page (remote or local) or launch IE from the
> mintty/bash command line?
> I've tried the following:
> $ cygstart "http://www.google.com"
> $ cygstart index.html # local page
> $ "/cygdrive/c/Program Files/Internet Explorer/iexplore.exe"
> $ cygstart "/cygdrive/c/Program Files/Internet Explorer/iexplore.exe"
> If IE is already open, the first two examples work, but otherwise, 
> for all 4, IE flashes a window, which immediately closes.

Check your URL associations and default apps, and always run 
Windows apps, or associated file types which run Windows apps, 
using cygstart.
I've never tried IE locally but don't recall ever having any issues 
on work systems where that was the mandatory default browser.

Have you tried rebooting - MS OS and apps seem to be able to go 
zombie so you have to do the three finger decapitation, then 
everything starts working normally again.

Firefox is my default browser and I've never had problems opening 
local web pages, URIs, .URL links, or any other associated content 
from bash, whether or not the browser or other app is already running.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: open IE from command line
  2016-12-20 17:20 ` Lee
  2016-12-20 22:10   ` cyg Simple
  2016-12-20 22:51   ` Andrey Repin
@ 2016-12-21 14:11   ` Nellis, Kenneth
  2016-12-21 14:46     ` Buchbinder, Barry (NIH/NIAID) [E]
                       ` (2 more replies)
  2 siblings, 3 replies; 20+ messages in thread
From: Nellis, Kenneth @ 2016-12-21 14:11 UTC (permalink / raw)
  To: cygwin

Thanx to all who responded to my query...

> On 12/20/16, Nellis, Kenneth wrote:
> > How to open a web page (remote or local) or launch IE from the
> > mintty/bash command line?

I've tried all the suggestions and the same thing happens:
IE flashes on the screen and immediately disappears.
Indeed, IE is my default browser.

I suspect the issue is that some required DLLs are not in
my PATH. Indeed, my Cygwin PATH is a pruned version of my 
Windows PATH.

--Ken Nellis

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: open IE from command line
  2016-12-21 14:11   ` Nellis, Kenneth
@ 2016-12-21 14:46     ` Buchbinder, Barry (NIH/NIAID) [E]
  2016-12-21 16:14     ` Lee
  2016-12-21 17:01     ` Nellis, Kenneth
  2 siblings, 0 replies; 20+ messages in thread
From: Buchbinder, Barry (NIH/NIAID) [E] @ 2016-12-21 14:46 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1150 bytes --]

Nellis, Kenneth sent the following at Wednesday, December 21, 2016 9:11 AM
>Thanx to all who responded to my query...
>> On 12/20/16, Nellis, Kenneth wrote:
>> > How to open a web page (remote or local) or launch IE from the
>> > mintty/bash command line?
>
>I've tried all the suggestions and the same thing happens: IE flashes on
>the screen and immediately disappears. Indeed, IE is my default browser.
>
>I suspect the issue is that some required DLLs are not in my PATH.
>Indeed, my Cygwin PATH is a pruned version of my Windows PATH.

If you have a Windows shortcut to IE, try
cygstart "C:\[path to shortcut]\Internet Explorer.lnk"

For the record, these work for me:
cygstart "C:\Program Files\Internet Explorer\iexplore.exe" 
cygstart "C:\Program Files\Internet Explorer\iexplore.exe" "http://www.google.com" 

- Barry
  Disclaimer: Statements made herein are not made on behalf of NIAID.


\0ТÒÐÐ¥\a&ö&ÆVÒ\a&W\x06÷'G3¢\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒ÷\a&ö&ÆV×2æ‡FÖÀФd\x15\x13¢\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöf\x17\x12ðФFö7VÖVçF\x17F–öã¢\x02\x02\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöFö72æ‡FÖÀÐ¥Vç7V'67&–&R\x06–æfó¢\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöÖÂò7Vç7V'67&–&R×6–×\x06ÆPРÐ

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: open IE from command line
  2016-12-21 14:11   ` Nellis, Kenneth
  2016-12-21 14:46     ` Buchbinder, Barry (NIH/NIAID) [E]
@ 2016-12-21 16:14     ` Lee
  2016-12-21 17:01     ` Nellis, Kenneth
  2 siblings, 0 replies; 20+ messages in thread
From: Lee @ 2016-12-21 16:14 UTC (permalink / raw)
  To: cygwin

On 12/21/16, Nellis, Kenneth wrote:
> Thanx to all who responded to my query...
>
>> On 12/20/16, Nellis, Kenneth wrote:
>> > How to open a web page (remote or local) or launch IE from the
>> > mintty/bash command line?
>
> I've tried all the suggestions and the same thing happens:
> IE flashes on the screen and immediately disappears.
> Indeed, IE is my default browser.
>
> I suspect the issue is that some required DLLs are not in
> my PATH.

Not a problem for me:
$ echo $PATH
/usr/bin

$ cmd /c "C:\Program Files\Internet Explorer\iexplore.exe"
"https://www.google.com"
-bash: cmd: command not found

$ cygstart "C:\Program Files\Internet Explorer\iexplore.exe"
"https://www.google.com"
  -- starts IE & loads www.google.com

What happens if you do
"C:\Program Files\Internet Explorer\iexplore.exe" "https://www.google.com"
in a dos window?

Lee

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: open IE from command line
  2016-12-21 14:11   ` Nellis, Kenneth
  2016-12-21 14:46     ` Buchbinder, Barry (NIH/NIAID) [E]
  2016-12-21 16:14     ` Lee
@ 2016-12-21 17:01     ` Nellis, Kenneth
  2016-12-22  1:04       ` Doug Henderson
  2 siblings, 1 reply; 20+ messages in thread
From: Nellis, Kenneth @ 2016-12-21 17:01 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 568 bytes --]

From: Nellis, Kenneth 
> I suspect the issue is that some required DLLs are not in
> my PATH. Indeed, my Cygwin PATH is a pruned version of my
> Windows PATH.

Actually, that's not the case and is irrelevant as Lee demon-
strates in https://cygwin.com/ml/cygwin/2016-12/msg00220.html.

Comparing the output from
Windows: C:/>path
and
cygwin/bash: $ cmd /c path
shows only new paths added to support Cygwin.

I'm on Microsoft Windows 7 Enterprise Edition, 64-bit Service Pack 1 (build 7601)

FWIW, output from "cygcheck -svr" attached.

--Ken Nellis

[-- Attachment #2: cygcheck.out --]
[-- Type: application/octet-stream, Size: 42458 bytes --]

[-- Attachment #3: Type: text/plain, Size: 219 bytes --]


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: open IE from command line
  2016-12-21 17:01     ` Nellis, Kenneth
@ 2016-12-22  1:04       ` Doug Henderson
  2016-12-22  1:25         ` Doug Henderson
  2016-12-22 13:51         ` cyg Simple
  0 siblings, 2 replies; 20+ messages in thread
From: Doug Henderson @ 2016-12-22  1:04 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1200 bytes --]

On 21 December 2016 at 10:01, Nellis, Kenneth wrote:
>
> From: Nellis, Kenneth
> > I suspect the issue is that some required DLLs are not in
> > my PATH. Indeed, my Cygwin PATH is a pruned version of my
> > Windows PATH.
>
> Actually, that's not the case and is irrelevant as Lee demon-
> strates in https://cygwin.com/ml/cygwin/2016-12/msg00220.html.
>
> Comparing the output from
> Windows: C:/>path
> and
> cygwin/bash: $ cmd /c path
> shows only new paths added to support Cygwin.
>
> I'm on Microsoft Windows 7 Enterprise Edition, 64-bit Service Pack 1 (build 7601)
>
> FWIW, output from "cygcheck -svr" attached.
>
> --Ken Nellis


Attached is a bash script, renamed as openurl.sh.txt, which will open
a url with either the default browser or Internet Explorer. It takes
care of the case when CYGWIN_NOWINPATH=1, and where COMSPEC does not
exist in the environment or does not point to an executable program or
when /cygdrive/c/ does not point to the C: disk.

Before using, strip CRs (just in case) using d2u (or dos2unix), rename
to openurl or openurl.sh or ..., place in your path, eg. $HOME/bin and
make executable.

HTH,
Doug

-- 
Doug Henderson, Calgary, Alberta, Canada - from gmail.com

[-- Attachment #2: openurl.sh.txt --]
[-- Type: text/plain, Size: 1961 bytes --]

#!/bin/bash
# Copyright (c) 2016 Doug Henderson
# Licence: GPL3
# Version: 1.0
#
# openurl[.sh] [IE] URL
#
# Open a URL in the default browser or in Internet Explorer.
# This will work properly when using CYGWIN_NOWINPATH=1
# Tested on Windows 7 Home Premium, Service Pack 1, fully patched
# and CYGWIN_NT-6.1 xxx 2.6.1(0.305/5/3) 2016-12-16 11:55 x86_64 Cygwin
#
# You may rename this file to meet your requirements.
#
# Quote the URL when it contains spaces or shell special characters.
#
# Usage:
#   openurl.sh [IE] URL
#
#   openurl.sh https://www.google.ca
#       open Google search with default browswer
#
#   openurl.sh IE https://www.google.ca
#       open Google search with Internet Explorer
#
if [ -n "${COMSPEC}" -a -x "$( cygpath -Ua "${CMD}" )" ] ; then
    # COMSPEC should contain the absolute windows path
    # to the CMD.EXE executable.
    CMD="${COMSPEC}"
else
    # Hard code path to windows CMD.EXE
    # You may need to change this depending on windows version
    # and install options.
    # Copy/paste from CompSpec variable on Command Prompt window.
    # Double all backslashes.
    CMD="C:\\Windows\\System32\\cmd.exe"
    # echo WARNING: using hardcoded path: ${CMD}
fi

# Make sure we know location of Command program.
if [ ! -x "$( cygpath -Ua "${CMD}" )" ] ; then
    echo ERROR: Please provide path to CMD.EXE
    exit 1
fi

IE="C:\\Program Files\\Internet Explorer\\iexplore.exe"
# echo WARNING: using hardcoded path: ${IE}
# Hardcode the location of the Internet Explorer EXE file.
# Copy/paste from Blue-E shortcut icon properties Target field.
# Double all backslashes.

if [ "$1" = "IE" ] ; then
    # Make sure we know location of Internet Explorer.
    if [ ! -x "$( cygpath -Ua "${IE}" )" ] ; then
        echo ERROR: Please provide path to IEXPLORE.EXE
        exit 1
    fi
    shift
    "$( cygpath -Ua "${CMD}" )" /D /S /C "START /I "${IE}" "$*""
else
    "$( cygpath -Ua "${CMD}" )" /D /S /C "START /I "$*""
fi

[-- Attachment #3: Type: text/plain, Size: 219 bytes --]


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: open IE from command line
  2016-12-22  1:04       ` Doug Henderson
@ 2016-12-22  1:25         ` Doug Henderson
  2016-12-22 13:43           ` Nellis, Kenneth
  2016-12-22 13:51         ` cyg Simple
  1 sibling, 1 reply; 20+ messages in thread
From: Doug Henderson @ 2016-12-22  1:25 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 510 bytes --]

On 21 December 2016 at 18:04, Doug Henderson  wrote:
> On 21 December 2016 at 10:01, Nellis, Kenneth wrote:

> Attached is a bash script, renamed as openurl.sh.txt, which will open
> a url with either the default browser or Internet Explorer. It takes

Last minute fix: before using the script, edit it to repair a copy/paste error.

26,26s/CMD/COMSPEC/

i.e. in line 26, both variable references should be to COMSPEC.


Attached is repaired copy

-- 
Doug Henderson, Calgary, Alberta, Canada - from gmail.com

[-- Attachment #2: openurl.sh.txt --]
[-- Type: text/plain, Size: 1965 bytes --]

#!/bin/bash
# Copyright (c) 2016 Doug Henderson
# Licence: GPL3
# Version: 1.0
#
# openurl[.sh] [IE] URL
#
# Open a URL in the default browser or in Internet Explorer.
# This will work properly when using CYGWIN_NOWINPATH=1
# Tested on Windows 7 Home Premium, Service Pack 1, fully patched
# and CYGWIN_NT-6.1 xxx 2.6.1(0.305/5/3) 2016-12-16 11:55 x86_64 Cygwin
#
# You may rename this file to meet your requirements.
#
# Quote the URL when it contains spaces or shell special characters.
#
# Usage:
#   openurl.sh [IE] URL
#
#   openurl.sh https://www.google.ca
#       open Google search with default browswer
#
#   openurl.sh IE https://www.google.ca
#       open Google search with Internet Explorer
#
if [ -n "${COMSPEC}" -a -x "$( cygpath -Ua "${COMSPEC}" )" ] ; then
    # COMSPEC should contain the absolute windows path
    # to the CMD.EXE executable.
    CMD="${COMSPEC}"
else
    # Hard code path to windows CMD.EXE
    # You may need to change this depending on windows version
    # and install options.
    # Copy/paste from CompSpec variable on Command Prompt window.
    # Double all backslashes.
    CMD="C:\\Windows\\System32\\cmd.exe"
    # echo WARNING: using hardcoded path: ${CMD}
fi

# Make sure we know location of Command program.
if [ ! -x "$( cygpath -Ua "${CMD}" )" ] ; then
    echo ERROR: Please provide path to CMD.EXE
    exit 1
fi

IE="C:\\Program Files\\Internet Explorer\\iexplore.exe"
# echo WARNING: using hardcoded path: ${IE}
# Hardcode the location of the Internet Explorer EXE file.
# Copy/paste from Blue-E shortcut icon properties Target field.
# Double all backslashes.

if [ "$1" = "IE" ] ; then
    # Make sure we know location of Internet Explorer.
    if [ ! -x "$( cygpath -Ua "${IE}" )" ] ; then
        echo ERROR: Please provide path to IEXPLORE.EXE
        exit 1
    fi
    shift
    "$( cygpath -Ua "${CMD}" )" /D /S /C "START /I "${IE}" "$*""
else
    "$( cygpath -Ua "${CMD}" )" /D /S /C "START /I "$*""
fi

[-- Attachment #3: Type: text/plain, Size: 219 bytes --]


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: open IE from command line
  2016-12-22  1:25         ` Doug Henderson
@ 2016-12-22 13:43           ` Nellis, Kenneth
  2016-12-22 13:54             ` cyg Simple
  0 siblings, 1 reply; 20+ messages in thread
From: Nellis, Kenneth @ 2016-12-22 13:43 UTC (permalink / raw)
  To: Doug Henderson, cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1115 bytes --]

> From: Doug Henderson
> On 21 December 2016 at 18:04, Doug Henderson  wrote:
> > On 21 December 2016 at 10:01, Nellis, Kenneth wrote:
> 
> > Attached is a bash script, renamed as openurl.sh.txt, which will open
> > a url with either the default browser or Internet Explorer. It takes
> 
> Last minute fix: before using the script, edit it to repair a copy/paste
> error.
> 
> 26,26s/CMD/COMSPEC/
> 
> i.e. in line 26, both variable references should be to COMSPEC.
> 
> 
> Attached is repaired copy

Thanx! That worked! Will have to scrutinize the script for the secret
sauce. Curiously, when opened in by script, IE, which is my default 
browser, no longer recognizes visited links by displaying them in a 
different color. No biggie. Also curious why others weren't having
this problem.

Regardless, the script is very helpful. Thanx, again!

--Ken Nellis

\x03B‹KCB”\x1c›Ø›\x19[H\x1c™\^[ܝ\x1cΈ\b\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÜ\x1c›Ø›\x19[\Ëš\x1d^[[\x03B‘TNˆ\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÙ˜\KÃB‘^[ØÝ[Y[\x18]\x1a[ÛŽˆ\b\b\b\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÙ^[ØÜËš\x1d^[[\x03B•[œÝXœØÜšX™H\x1a[™›Îˆ\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÛ[\vÈÝ[œÝXœØÜšX™K\Ú[\^[\x19CBƒB

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: open IE from command line
  2016-12-22  1:04       ` Doug Henderson
  2016-12-22  1:25         ` Doug Henderson
@ 2016-12-22 13:51         ` cyg Simple
  2016-12-22 14:26           ` Nellis, Kenneth
  1 sibling, 1 reply; 20+ messages in thread
From: cyg Simple @ 2016-12-22 13:51 UTC (permalink / raw)
  To: cygwin

On 12/21/2016 8:04 PM, Doug Henderson wrote:
> On 21 December 2016 at 10:01, Nellis, Kenneth wrote:
> 
> Before using, strip CRs (just in case) using d2u (or dos2unix), 
> 

FYI you can also use vi to translate those line endings

$ vi foo
:set ff=unix
:wq

or going the other direction,

$ vi foo
:set ff=dos
:wq

-- 
cyg Simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: open IE from command line
  2016-12-22 13:43           ` Nellis, Kenneth
@ 2016-12-22 13:54             ` cyg Simple
  0 siblings, 0 replies; 20+ messages in thread
From: cyg Simple @ 2016-12-22 13:54 UTC (permalink / raw)
  To: cygwin

On 12/22/2016 8:43 AM, Nellis, Kenneth wrote:
> Also curious why others weren't having
> this problem.
> 

I suspect that it is your minimized PATH.  I'm not using that
minimization because I need the Windows PATH to be productive.  I only
install a minimal set of Cygwin and use Windows native when possible.

-- 
cyg Simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: open IE from command line
  2016-12-22 13:51         ` cyg Simple
@ 2016-12-22 14:26           ` Nellis, Kenneth
  2016-12-22 15:51             ` Andrey Repin
  2016-12-22 18:14             ` Brian Inglis
  0 siblings, 2 replies; 20+ messages in thread
From: Nellis, Kenneth @ 2016-12-22 14:26 UTC (permalink / raw)
  To: cygwin

From: cyg Simple (https://cygwin.com/ml/cygwin/2016-12/msg00240.html)
> 
> FYI you can also use vi to translate those line endings
> 
> $ vi foo
> :set ff=unix
> :wq
> 
> or going the other direction,
> 
> $ vi foo
> :set ff=dos
> :wq

Actually, the file downloaded just fine without CRLF line endings.

From cyg Simple (https://cygwin.com/ml/cygwin/2016-12/msg00241.html)
> I suspect that it is your minimized PATH.  I'm not using that
> minimization because I need the Windows PATH to be productive.  I only
> install a minimal set of Cygwin and use Windows native when possible.

Actually, I reported in https://cygwin.com/ml/cygwin/2016-12/msg00222.html
that my paths were the same.

From: myself (https://cygwin.com/ml/cygwin/2016-12/msg00239.html)
> Thanx! That worked! Will have to scrutinize the script for the secret
> sauce. Curiously, when opened in by script, IE, which is my default 
> browser, no longer recognizes visited links by displaying them in a 
> different color. No biggie. Also curious why others weren't having
> this problem.

Mystery solved (to my satisfaction). After writing, I realized that the 
script wasn't working consistently, sometimes causing IE to misbehave as 
I originally posted. A bit of digging showed that it was working if 
invoked from a bash session initiated by "chere", but not otherwise. 
Comparing environment variables between the two, I notice my regular 
session doesn't include several variables that chere does. Prime suspects:
 * CommonProgramFiles(x86)
 * CommonProgramW6432
 * PUBLIC
 * ProgramData
 * ProgramFiles(x86)
 * ProgramW6432
Experimentation will no doubt find the culprit, and will put me back
in business.

Thanx for all the help!

--Ken Nellis

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: open IE from command line
  2016-12-22 14:26           ` Nellis, Kenneth
@ 2016-12-22 15:51             ` Andrey Repin
  2016-12-22 20:56               ` Nellis, Kenneth
  2016-12-22 18:14             ` Brian Inglis
  1 sibling, 1 reply; 20+ messages in thread
From: Andrey Repin @ 2016-12-22 15:51 UTC (permalink / raw)
  To: Nellis, Kenneth, cygwin

Greetings, Nellis, Kenneth!

> Mystery solved (to my satisfaction). After writing, I realized that the
> script wasn't working consistently, sometimes causing IE to misbehave as 
> I originally posted. A bit of digging showed that it was working if 
> invoked from a bash session initiated by "chere", but not otherwise. 
> Comparing environment variables between the two, I notice my regular 
> session doesn't include several variables that chere does. Prime suspects:
>  * CommonProgramFiles(x86)
>  * CommonProgramW6432
>  * PUBLIC
>  * ProgramData
>  * ProgramFiles(x86)
>  * ProgramW6432
> Experimentation will no doubt find the culprit, and will put me back
> in business.

> Thanx for all the help!

%ProgramData% and %PUBLIC% is a likely culprit.


-- 
With best regards,
Andrey Repin
Thursday, December 22, 2016 18:45:27

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: open IE from command line
  2016-12-22 14:26           ` Nellis, Kenneth
  2016-12-22 15:51             ` Andrey Repin
@ 2016-12-22 18:14             ` Brian Inglis
  1 sibling, 0 replies; 20+ messages in thread
From: Brian Inglis @ 2016-12-22 18:14 UTC (permalink / raw)
  To: cygwin

On 2016-12-22 07:25, Nellis, Kenneth wrote:
> Mystery solved (to my satisfaction). After writing, I realized that
> the script wasn't working consistently, sometimes causing IE to
> misbehave as I originally posted. A bit of digging showed that it was
> working if invoked from a bash session initiated by "chere", but not
> otherwise. Comparing environment variables between the two, I notice
> my regular session doesn't include several variables that chere does.
> Prime suspects:
>  * CommonProgramFiles(x86)
>  * CommonProgramW6432
>  * PUBLIC
>  * ProgramData
>  * ProgramFiles(x86)
>  * ProgramW6432
> Experimentation will no doubt find the culprit, and will put me back 
> in business.

Check your Cygwin/mintty startup shortcut target or other command line 
looks like: 
	"...\bin\mintty.exe -i /Cygwin-Terminal.ico -"
where the final " -" ensures that the shell is invoked as a login shell, 
otherwise normal login setup may not be done correctly or fully.

Confirm that you still have /bin/cygwin-console-helper installed.

Failing that, check if your profile or rc scripts are doing, using, or 
invoking something which sanitizes your environment or changes it 
incompatibly.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: open IE from command line
  2016-12-22 15:51             ` Andrey Repin
@ 2016-12-22 20:56               ` Nellis, Kenneth
  0 siblings, 0 replies; 20+ messages in thread
From: Nellis, Kenneth @ 2016-12-22 20:56 UTC (permalink / raw)
  To: cygwin

From: Andrey Repin
> %ProgramData% and %PUBLIC% is a likely culprit.

Thanx, but those didn't actually matter. The one causing the problem was 
ProgramW6432. Once I restored it, I could open web pages using cygstart.

--Ken Nellis

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2016-12-22 20:56 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-20 16:15 open IE from command line Nellis, Kenneth
2016-12-20 17:20 ` Lee
2016-12-20 22:10   ` cyg Simple
2016-12-20 22:51   ` Andrey Repin
2016-12-20 23:32     ` Eliot Moss
2016-12-21  0:50       ` Lee
2016-12-21 14:11   ` Nellis, Kenneth
2016-12-21 14:46     ` Buchbinder, Barry (NIH/NIAID) [E]
2016-12-21 16:14     ` Lee
2016-12-21 17:01     ` Nellis, Kenneth
2016-12-22  1:04       ` Doug Henderson
2016-12-22  1:25         ` Doug Henderson
2016-12-22 13:43           ` Nellis, Kenneth
2016-12-22 13:54             ` cyg Simple
2016-12-22 13:51         ` cyg Simple
2016-12-22 14:26           ` Nellis, Kenneth
2016-12-22 15:51             ` Andrey Repin
2016-12-22 20:56               ` Nellis, Kenneth
2016-12-22 18:14             ` Brian Inglis
2016-12-21  7:30 ` Brian Inglis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).