How would I write a .bat file to open a popup

Can anyone tell me how to write a .bat file that will open a tiny popup window with links to html pages. No resize, no tool or address bar, nothing but a tiny window with links.
GD_GRAYAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Bill PrewConnect With a Mentor Commented:
Do you want the links displayed to be clickable, and if clicked open the link in the default brower?

If so that is a tall order for a BAT file, not sure there is any way to do that with native BAT capabilities.  You could build an HTML file or the links, and open it, but it will open a full browser window with menu bar, etc.  

~bp
0
 
GD_GRAYAuthor Commented:
LoL, yea thats kind of what I was thinking. Im working with a web base software I can add exe, com links to run other programs like mapping and excel. But when I add an html link it over takes the curent window and in order to go back the user has to logback in.... The software wont allow any variables so I cant tell it to open a new window. Thats why I thought maybe a bat with links....lol, it was just a thought. Thanks.....
0
 
QlemoConnect With a Mentor DeveloperCommented:
No, you can't do it with pure (poor) MS DOS batch means. You can use VBS to build a Rich Text field containing the links. Or PowerShell (what will be almost the same).

You can use traditional choice menus, that is you have to type a single letter or digit for the action you want to perform. But I don't think that is what you want ...
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
GD_GRAYAuthor Commented:
Thank you two... how come the easy way always winds up the hardest...lol
0
 
QlemoDeveloperCommented:
It's simple - we live in a complex world :))
0
 
BillDLCommented:
I think you're looking for an *.HTA script.  Personally I don't like HTA files because they are able to extend normal web code functionality (JavaScript, WMI, VBS, etc) way beyond all security checks performed by a browser, and that can present a security risk.  You can get an HTA file to do things that an HTML file would never be allowed to do in a browser.  They do have their places though.

An HTA file type is executed by MSHTA.EXE with the command:
%SystemRoot%\system32\mshta.exe "%1" %*
so it really is treated as an executable even though it is just extended HTML code.

The reason I suggest this is because it is easy enough to call an HTA file from the command line or batch file, and it would theoretically be possible to redirect fragments of code to an HTA file on the fly from a batch file, execute it, then delete it again. You can control whether an HTA popup window shows toolbarrs, etc or not.

HTA Scripting references:
http://technet.microsoft.com/en-us/scriptcenter/dd742317.aspx

I have attached the very basic skeleton code of an HTA script in the Code Snippet.  Copy it out, paste into Windows Notepad, and save out as any file name with the *.HTA extension.  Double-Click and it should open a standard application window with nothing in it.

There is a little utility program, actually an HTA application itself, that provides you with examples when run:
http://www.microsoft.com/downloads/details.aspx?FamilyId=231D8143-F21B-4707-B583-AE7B9152E6D9&displaylang=en

<html>
<head>
<title>Example HTA Window</title>

<HTA:APPLICATION 
     ID="objHTAsample"
     APPLICATIONNAME="HTAsample"
     SCROLL="yes"
     SINGLEINSTANCE="yes"
     WINDOWSTATE="normal"
>
</head>

<SCRIPT Language="VBScript">
</SCRIPT>
<body>

</body>
</html>

Open in new window

0
 
BillDLCommented:
The following code would open a box showing whatever text you want, and a single-clickable Hyperlink.

Is this any good to you?
<html>
<head>
<title>My Hyperlink Test</title>

<HTA:APPLICATION 
     ID="objHTAsample"
     APPLICATIONNAME="HTAsample"
     SCROLL="yes"
     SINGLEINSTANCE="yes"
     WINDOWSTATE="normal"
>
</head>

<SCRIPT Language="VBScript">
</SCRIPT>

<body>
<center>
<b><u>Example Links</u></b>
</center>
<p>
<HR>
<p>
<a href="http://www.experts-exchange.com" target="blank"><b>E-E Home Page</b></a href>
<p>
<a href="http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/Q_25713483.html" target="blank"><b>My E-E Question</b></a href>
<p>
</body>

</html>

Open in new window

0
 
BillDLCommented:
OK, so I know that this question has now been closed while I was typing, and with a "not really possible in pure batch" correct answer, but just out of completeness I should explain what I meant about having your batch file create, execute, and then destroy an HTA file on the fly.

To redirect text to a file from a batch file just ECHO the text and use the appropriate redirect symbol:
echo some text> filename.hta    creates new or overwrites existing content
echo some text>> filename.hta    creates new or appends to existing content

Some characters are reserved and would be treated as commands in a batch file, but you can have them treated literally as text and redirected as text by immediately preceding them with a caret ^

echo ^<HTML^>>> filename.hta

To create a blank line, use the echo. and redirect as normal:
echo. >> filename.hta

It is possible to write HTML, HTA, and any other file that uses plain text this way.
0
All Courses

From novice to tech pro — start learning today.