?
Solved

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

Posted on 2015-01-30
4
Medium Priority
?
326 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 84

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 84

Accepted Solution

by:
Dave Baldwin earned 2000 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 84

Expert Comment

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

Featured Post

How To Install Bash on Windows 10

Windows’ budding partnership with Canonical has certainly led to some great improvements. One of them being the ability to use Bash on your Windows machine without third party applications! This might be one of the greatest things a cloud engineer in a Windows environment can do!

Question has a verified solution.

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

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 …
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

752 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