WAD Start /pgm "name.htm" works improperly

#1
I am trying to wrie a .BAT that forms a .htm text file and then opens this file in a browser.

The command
start /pgm "E:/_TXT_/DIMA/MISC/Y~B_REFS.HTM"
tries to open the address
http://files/JPSoft_TCMD/ide.exe --...rowser.exe -- E:/_TXT_/DIMA/MISC/Y~B_REFS.HTM
and the browser says the page not exists while the file E:/_TXT_/DIMA/MISC/Y~B_REFS.HTM exists and contains a proper HTML text. I can to see the text by double-clicking this file in the Windows Explorer window. The Yandex Browser is set up to be used by default in my system.
 
#2
I don't (can't) use short file names. It works OK here with firefox. You might try:

start /pgm "file:///E:/_TXT_/DIMA/MISC/Y~B_REFS.HTM"

and/or the same thing with a long file name. If you do that, the browser should NOT try to use HTTP.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,675
46
Albuquerque, NM
prospero.unm.edu
#3
Works here with Chrome. You may be bumping into some peculiarity in your browser's command line parsing. Vincent's suggestion of prefixing file:/// looks like a good idea to me. Note that there are three forward slashes between file: and the drive letter.

You could also try
Code:
ftype %@assoc[.htm]
to see what Explorer does with that filename.
 

rconn

Administrator
Staff member
May 14, 2008
10,646
97
#4
This is Windows doing this, not TCC.

Assuming you don't have an executable extension for .htm, that extension is unknown to TCC. So what TCC does is call the Windows AssocQueryString function to see what Windows wants to do with it. On my system, Windows returns "C:\\WINDOWS\\system32\\LaunchWinApp.exe\" "%1". TCC replaces the %1 with the fully qualified .htm name, and passes the resulting command off to Windows to execute.

I tried on several systems, and none of them attempted to convert that to #1 Windows Command Prompt | Windows Console Replacement... (Unless the .htm file is referencing that site).

Note that the "start /pgm …" is unnecessary; TCC will do the same thing if you just enter the .htm filename.