mshta without splash :
Code: Select all
@echo off
mshta.exe "%~f0"|more
exit /b
<HTA:Application
ShowInTaskbar = no
WindowsState=Minimize
SysMenu=No
ShowInTaskbar=No
Caption=No
Border=Thin
>
<script language="javascript" type="text/javascript">
window.visible=false;
window.resizeTo(1,1);
var fso= new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1);
fso.WriteLine("waiting 5 seconds");
function waitSeconds(iMilliSeconds) {
var counter= 0
, start = new Date().getTime()
, end = 0;
while (counter < iMilliSeconds) {
end = new Date().getTime();
counter = end - start;
}
}
waitSeconds(5000);
var fso= new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1);
close(fso.Write("test hta window visibility"));
</script>
the mshta splash is not visible , but for moment the focus is lost from the cmd console.
At the beginning it sets some hta tags to reduce interaction elements (though the hta part can be removed - it is not the important part - without it for a moment a small window will be visible while application is closed) :
Code: Select all
https://technet.microsoft.com/en-us/library/ee176567.aspx
then applies on the window object (the mother and the father of everything in javascript when the context is a browser) resize and visibility to false.
as the HTA is some kind of internet explorer you can use methods/properties from IWebBrowser2 :
Code: Select all
https://msdn.microsoft.com/en-us/library/aa752127(v=vs.85).aspx