By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

WAD Start /pgm "name.htm" works improperly

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
files/JPSoft_TCMD/ide.exe --external-app-data=ee4-0008057C-4-1-0 --original-process-start-time=13186182911566518 --fast-start C:/Users/Дмитрий/AppData/Local/Yandex/YandexBrowser/Application/browser.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.
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.
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
ftype %@assoc[.htm]
to see what Explorer does with that filename.
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.
The command
start /pgm "E:/_TXT_/DIMA/MISC/Y~B_REFS.HTM"
tries to open the address
To begin with, your command has no actual command in it.
I wonder why it does anything at all.
The "/PGM" switch expects the following parameter to be a starting window title for an executing program.
For default CMD START implementation this is simply first quoted string.
Said that, this might be an actual bug in TCC, but not the one you'd mentioned.

Similar threads