Solved

How to show "Month" and date in Title - HTA Script

Posted on 2015-01-30
4
255 Views
Last Modified: 2015-02-02
Hi Guys,

Can anybody help me out to modify HTA script code so the current date (month with date) auto update in the title of popup window?

Here is the beginning of HTA script code....

<head>

<title>Subject: IS Alert: Scheduled Maintenance: Friday, January 2 at 6:00 PM to Saturday January 3 at 1:00AM

</title> <body background = "background.jpg">
<HTA:APPLICATION APPLICATIONNAME="NetworkGroup" SCROLL="NO" SINGLEINSTANCE="yes" WINDOWSTATE="normal" SYSMENU="no">
0
Comment
Question by:Szuromi
  • 3
4 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40580697
I don't think that you can do that.  I can only get VBscript to 'write' in the <body> and not in the <head> section.
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 40581090
I spoke too soon.  I had something out of order.  This demo shows how to do it.
<HTML>
<HEAD>
<HTA:APPLICATION ID="HelloExample" 
   BORDER="thick" 
   BORDERSTYLE="complex"/>
<SCRIPT LANGUAGE="VBScript">
DIM Mydate
Mydate = Date
DIM Mdays 
Mdays = Array("Surfin' Sunday","Moody Monday","Too Much Tuesday","Wild Wednesday","Thrilling Thursday","Finally Friday","Shopping Saturday")
DIM Mmonth
Mmonth = Array("Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec")
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Document.Write "<TITLE>HTA - Hello World " & Mdays(Weekday(Mydate)-1) & "</TITLE>"
</script>

</HEAD>
<BODY>
<H2>HTA - Hello World</H2>
<SCRIPT LANGUAGE="VBScript">
Document.Write Mdays(Weekday(Mydate)-1)
</script>

</BODY>
</HTML>

Open in new window

0
 

Author Closing Comment

by:Szuromi
ID: 40584514
Hi Dave,

It is excellent.

Thank you very much!

Emese
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40584536
You're welcome, glad to help.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn how to count occurrences of each item in an array.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question