Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

HTA Error: Blank screen

$
0
0

Hello All,

I've to create an HTA file that will work during Windows Installation on a new machine.

I'm tying to test my sample HTA file but during installation startup, all I'm seeing is "a blank white window".

Below is the code of my HTA file:

<html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"><style>
.fullbackground{
    ;
	width:100%; /* alternative: right:0; */
    height:100%; /* alternative: bottom:0; */
}
img.fullbackground{
    ;
    z-index:-1;
    top:0;
    left:0;
    width:100%; /* alternative: right:0; */
    height:100%; /* alternative: bottom:0; */
}

.messageSection { ; width: 100%; }



.mainbody,
.header,
.footer {
    padding: 5px;
}
.mainbody {
    margin-top: 25px;
    min-height: 150px;
    max-height: 388px;
    overflow: auto;
}
.messagePara {	font-family: Calibri; font-size: 16pt; font-weight: bold; color: #FFFFFF; text-align: center;  margin-left:20%; margin-right:20%; margin-bottom:20%;}

.header {

    margin: auto;
    width: 60%;

    padding: 10px;
	text-align:left;
	color: #FFFFFF; font-family: Calibri; font-size: 14pt; font-weight: bold; margin-top:30px;


}
.footer {
    height: 40px;

    -webkit-border-bottom-left-radius: 5px;
    -webkit-border-bottom-right-radius: 5px;
    -moz-border-radius-bottomleft: 5px;
    -moz-border-radius-bottomright: 5px;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;

	font-family: Calibri; font-size: 11pt; font-weight: bold; color: #FFFFFF; text-align: center; ; width:100%;	bottom:0;	left:0;
}

    </style><HTA:APPLICATION ID="oHTA"
         BORDER="none"
         CAPTION="no"
         CONTEXTMENU="no"
         Icon="autorun.ico"
         INNERBORDER="no"
         NAVIGABLE="yes"
         SCROLL="no"/><script language="javascript">

	var __TITLE_VAR_TEXT   		      = "Sample Title";
    var __COPYRIGHT_VAR_TEXT          = "Sample Footer";
    var __MESSAGE_DISC_VAR_TEXT        = "Sample Message";
    var __LINKBODYBACKGROUND_VAR_TEXT = "Sample.jpg"; //background image

    var splashWindowWidth  = 637;
    var splashWindowHeight = 479;


    if (window.screen)
    {

        splashWindowLeft = (window.screen.availWidth - splashWindowWidth) / 2;
        splashWindowTop  = (window.screen.availHeight - splashWindowHeight) / 2;
    }

    try
    {

        window.moveTo(splashWindowLeft, splashWindowTop);
        window.resizeTo(splashWindowWidth, splashWindowHeight);
    }
    catch(e){}



    function windowOnLoad()
    {
		maxWindow();
        document.title = __MESSAGE_DISC_VAR_TEXT;

		document.getElementById("image").src=__LINKBODYBACKGROUND_VAR_TEXT;

        window.setTimeout("closeScreen()",5000);

    }

    function closeScreen()
    {
        self.close();
    }



function maxWindow()
{
window.moveTo(0,0);

if (document.all)
{
  top.window.resizeTo(screen.availWidth,screen.availHeight);
}

else if (document.layers||document.getElementById)
{
  if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
  {
    top.window.outerHeight = screen.availHeight;
    top.window.outerWidth = screen.availWidth;
  }
}
}</script></head><body style="text-align: center; " onload="windowOnLoad()"><div class="fullbackground"><img id="image" class="fullbackground" /><div class="header"> <script language="javascript">document.write(__TITLE_VAR_TEXT);</script></div><div class="mainbody"><p id="messagePara" class="messagePara"><script language="javascript">document.write(__MESSAGE_DISC_VAR_TEXT);</script></p></div><div class="footer"> <script language="javascript">document.write(__COPYRIGHT_VAR_TEXT); </script></div></div></body></html>

I've updated the required INI file with the following entries:-

[Sample]
type = command
Caption=Launching user interface
Reboot=No
CommandLine="mshta.exe %programfiles%\Folder_1\Folder_2\Folder_3\Folder_4\Sample.hta"

I've referred the below URLs :-

http://www.windows-noob.com/forums/topic/5968-hta-blank-screen/

http://blogs.msdn.com/b/joelschoenberg/archive/2008/08/18/maintenance-booting-your-windows-machines.aspx

But none of the options worked.

I also tried with passing the HTA file in arguments as mentioned below:-

CommandLine=mshta.exe
Arguments="%programfiles%\Folder_1\Folder_2\Folder_3\Folder_4\Sample.hta"

but it didn't worked.

NOTE: I've also used the direct path of "Sample.hta" file but it still didn't show up.

Before installation, I've tried pressing F8 key and running the HTA using mshta.exe and that works completely fine.

Can anyone please share some suggestions of how to execute this "HTA" from INI file and the correct commandLine value ?

Thanks in advance.

TECHIT_ASHISH


Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>