Solved

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

Posted on 2015-01-30
4
233 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 82

Expert Comment

by:Dave Baldwin
Comment Utility
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 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
Comment Utility
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
Comment Utility
Hi Dave,

It is excellent.

Thank you very much!

Emese
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
You're welcome, glad to help.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn how to dynamically set the form action using jQuery.

728 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now