Is it possible to get ie to render a document as html with an extension that is not .htm or .html? (Windows) - windows

I am trying to get an html document that's saved on the file system to run through a vbscript first (to check for script injection) and then open in Internet Explorer if the check passes. I have written the vbscript as well as a .bat to call the script, and all of this works when I don't change the file extension (.htm or .html) but do "open with..." and select my .bat file - the vbscript opens it in IE. But when I change the file extension, IE automatically opens the download dialog instead of rendering the html. I want to use a custom extension as a way of only running certain html docs through my script.
So my question is: Is there a way to get Internet Explorer to recognize and render the document in a file with a custom extension?

CatCat's comment about setting the MIME type is the right answer

Related

Can Firefox be "automated"?

I have a PHP file on the server that creates a backup and then returns it as a zip file. There is no HTML returned, just the ZIP file.
My question is:
How can I call Firefox, pass the URL, and tell it where to save the file, and then have that instance of Firefox close? I plan on using Windows Task Scheduler to call this page once per day. The zip file produced has a unique name.
I've seen the option to pass the url, and that works just fine. I also saw the option to open it in a new window. So far I've tried the code below. It opens the file, and the save file dialog. I want this to happen silently.
If there's a better way to accomplish this using another tool rather than Firefox, that would be very helpful.
firefox -new-window https://example.com/bk/makebackup.php?u=username&p=pw&site=site_to_backup

Forcing a launcher to be opened with Internet Explorer

Ok, I've read here and here that is not possible, on a gerneral browser, to force a link to be opened in IE.
So my question is: can I do it with a desktop launcher?
Extended question: Can I easily create a desktop launcher on Windows (10, 7 and maybe older versions) that if double clicked opens a specific URL in IE?
You can create a batch file to run the command to open IE with a specific url. You can create a .bat file and put the following code in the file:
start iexplore "http://www.bing.com"
Double click the .bat file, then it will open IE with Bing website.
Result:

How can I launch a VBA script from within Firefox on Windows XP?

I'd like to do the following:
In Mozilla Firefox by clicking a button or pressing a shortcut the URL of the current browser tab is copied and then Microsoft Excel (XP) is opened and a VBA script is launched, which takes the URL as an argument.
How can I do that?
It sounds like your VBA script is in an Excel spreadsheet, and you want it to automatically execute when you invoke the .xls(x) from Firefox.
If so, you can try this:
1) Write your VBA as an "Auto_Open macro" or use the "Open" event on your worksheet:
http://office.microsoft.com/en-us/excel-help/running-a-macro-when-excel-starts-HA001034628.aspx
2) Make sure your Windows file associations are set so that Firefox will open your .xls(x) file or link with MS Excel
3) You can use a file URL, format file://host/path to link to the document

How to start to write a Windows context menu

I would like to write a context menu for Markdown files for Windows XP, when I right click on a Markdown file it should display "View in browser" option. It could use MardownSharp or Discount to convert it in HTML and show it using the default browser. I guess that building such feature shouldn't require too much knowledge of the Windows platform. My question is: where should I start considering the fact that I would want to write this tool without using MS Visual Studio (I would like to use opensource software)? Could it be possible to use Mono?
See this answer on how to convert Markdown to HTML. As far as adding this as a context menu, this is a built-in feature of the Windows registry:
Browse to or create the following key. This assumes the file extension is .mdml (as I am unfamiliar with any set standard on this file format). If that's not the case, replace .mdml with the file extension(s) you are looking for, or * for all files, regardless of extension.
HKEY_CLASSES_ROOT\.mdml\Shell\
Browse to or create a new sub-key called something like "View in browser" and a sub-sub-key called "Command" (must be this word). In that key, modify the default to display the program and arguments to launch (e.g. C:\WINDOWS\SYSTEM32\NOTEPAD.EXE "%1").
You should now be able to browse to
HKEY_CLASSES_ROOT\.mdml\Shell\View in browser\Command\
and see the launch parameters in (Default).

Expression Web: Shortcut doesn't point to an exe file, but I want to use it to edit

Problem: I have to support users who need to edit web pages. Some of these web pages exist only as textarea controls. Fortunately, there is a firefox plugin that allows the user to open the textarea in a default text editor. Unfortunately, this plugin requires you to point to the EXE file of the text editor you want to invoke.
This is a reasonable requirement, but ##$%^ Microsoft Expression Web is one of those applications whose shortcut .lnk file does not appear to point to a real EXE file. If there is an EXE file somewhere, it's hidden.
Question:
How can I locate the actual EXE file so people can configure Microsoft Expression web to be their editor of choice?
Update: I should have emphasized that I was looking for a way to automate this via script or batch file (hence the SO posting, in case anyone's "not-programming-related" spidey sense was tingling).
I found my executable in the following location:
C:\Program Files\Microsoft Expression\Web Designer\EXPRWD.EXE
I'm not sure if that gives you what you need, but you can always have your users (or programmatically) search for EXPRWD.EXE and go from there.

Resources