Command line to open a link from emails

User Help for Mozilla Thunderbird
Post Reply
OZO
Posts: 40
Joined: March 2nd, 2009, 7:58 pm

Command line to open a link from emails

Post by OZO »

I'm using Thunderbird v52.1.1 (x32) and I need to open Internet links in Slimjet browser. I followed instructions from this page - Changing the web browser invoked by Thunderbird and I've got an unexpected problem.

I always open my browser running BAT file with this command line:

Code: Select all

"C:\WINDOWS\CMD\cmdh.exe" D:\Sys\Network\Browser\Slimjet\SjNewInst.bat
But when I try to enter this command line, Thunderbird says: "The file name is not valid"... Why it's not valid, if I always use it to launch my Slimjet browser...

OK, if I set TB to call BAT file directly, TB accepts it as a valid command line:

Code: Select all

D:\Sys\Network\Browser\Slimjet\SjNewInst.bat
But in this case, every time I open link from email I see a black CMD windows on the screen. I use CMDH tool specifically to hide it. It's convenient and is working very well for the purpose of running any BAT files without an unnecessary distraction.

How to set TB to call that command line in order to launch my browser?

I'd try to use network.protocol-handler.app option. But my TB 52.1.1 doesn't have it at all.

It looks like I'm stuck with looking at black CMD window on the screen every time I open a link from email or I need a help from TB developers / support.

I don't know what kind of check TB is doing here, bit it certainly makes it less flexible for its users.

Could you guys please take a command line as it is and just use it?

Please help and thank you in advance!
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Command line to open a link from emails

Post by tanstaafl »

Why not have it call the Slimjet executable directly (with any extra command line arguments you want it to use)? Its possible it will not create a console window when its launched.
morat
Posts: 6432
Joined: February 3rd, 2009, 6:29 pm

Re: Command line to open a link from emails

Post by morat »

Try this:

Code: Select all

"C:\WINDOWS\CMD\cmdh.exe" D:\\Sys\\Network\\Browser\\Slimjet\\SjNewInst.bat
OZO
Posts: 40
Joined: March 2nd, 2009, 7:58 pm

Re: Command line to open a link from emails

Post by OZO »

tanstaafl wrote:Why not have it call the Slimjet executable directly (with any extra command line arguments you want it to use)? Its possible it will not create a console window when its launched.
The reason I use BAT file is - I run Slimjet with temporary profiles. BAT file creates temporary profiles and calls browser. Then after I close browser, BAT file removes temporary profile. It's a simple and reliable way to separate browser sessions. I can run as many browsers as I need at the same time and all of them will use their own profiles... It's both security/privacy and convenience. I use this approach with all modern browsers (Chrome, Firefox).

The idea of running separate sessions by using different profiles is coming from this page. You can download BAT file from there (as I did), make your corrections (if needed) and then run it with your browser. It's simple and effective at the same time. :D
morat wrote:Try this:

Code: Select all

"C:\WINDOWS\CMD\cmdh.exe" D:\\Sys\\Network\\Browser\\Slimjet\\SjNewInst.bat
Unfortunately it doesn't work, yielding the same result - " "The file name is not valid"

Thank you guys for suggestions. Please keep them coming :)
morat
Posts: 6432
Joined: February 3rd, 2009, 6:29 pm

Re: Command line to open a link from emails

Post by morat »

Try this:

* create the "C:\test.vbs" file
* set network.protocol-handler.warn-external.https to true in about:config
* delete action in tools > options > attachments > incoming > content type https
* left click a https link
* choose file in the launch application window
* paste "C:\test.vbs" in text box
* check remember my choice
* open link

Code: Select all

Option Explicit
Dim objShell
Set objShell = CreateObject("WScript.Shell")
  objShell.Run chr(34) & "C:\WINDOWS\CMD\cmdh.exe" & chr(34) & " " & chr(34) & "D:\Sys\Network\Browser\Slimjet\SjNewInst.bat" & chr(34) & " " & WScript.Arguments(0), 0, False
Set objShell = Nothing
Or

Code: Select all

Option Explicit
Dim objShell
Set objShell = CreateObject("WScript.Shell")
  objShell.Run chr(34) & "D:\Sys\Network\Browser\Slimjet\SjNewInst.bat" & chr(34) & " " & WScript.Arguments(0), 0, False
Set objShell = Nothing
The .vbs script will hide the batch window.

VBScript
http://en.wikipedia.org/wiki/VBScript
http://ss64.com/vb/
http://ss64.com/vb/run.html

mimeTypes.rdf
http://kb.mozillazine.org/MimeTypes.rdf

I tested the solution with the following script. It works for me.

Code: Select all

Option Explicit
Dim objShell
Set objShell = CreateObject("WScript.Shell")
  objShell.Run chr(34) & "C:\Program Files\Google\Chrome\Application\chrome.exe" & chr(34) & " " & chr(34) & "--incognito" & chr(34) & " " & WScript.Arguments(0), 0, False
Set objShell = Nothing
OZO
Posts: 40
Joined: March 2nd, 2009, 7:58 pm

Re: Command line to open a link from emails

Post by OZO »

@morat,
Thanks a lot for the idea. It works! I actually implemented it with JavaScript file, but the idea remains the same. :)
morat
Posts: 6432
Joined: February 3rd, 2009, 6:29 pm

Re: Command line to open a link from emails

Post by morat »

You're welcome.
Post Reply