Wrong escaped nested double quotes: instead of
... new ActiveXObject(""Scripting.FileSystemObject"")...
use single quotation marks as follows:
... new ActiveXObject('Scripting.FileSystemObject')...
Edit: in your HTATest.hta
I see some weird for me approach:
- nested
<script> ... <script> ... </script> ... </script>
- launched
mshta.exe
from HTATest.hta
i.e., as a matter of fact, from mshta.exe HTATest.hta
Next hta
works(?):
<html>
<head>
<title>HTA Test
</title>
<HTA:APPLICATION ID="objTest" APPLICATIONNAME="HTATest" SCROLL="no" SINGLEINSTANCE="yes" >
</head>
<SCRIPT LANGUAGE="VBScript">
Path = BrowseToFile
msgboxx= "Path = " & Path
Function BrowseToFile()
Set wShell=CreateObject("WScript.Shell")
mshtapar="about:<input type=file id=FILE>"_
& "<script>FILE.click();"_
& "new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.value);"_
& "close();"_
& "resizeTo(0,0);"_
& "<//script>"
msgboxy= "param =" & mshtapar
Set oExec=wShell.Exec( "mshta.exe " & """" & mshtapar & """")
End Function
</SCRIPT>
<body>
</body>
Note <//script>
instead of </script>
within BrowseToFile()
function. However, this workaround I don't regard as a solution...
Here's a simple hta
example: does the same as yours one but without troubles
<html>
<head>
<title>HTA Test
</title>
<HTA:APPLICATION ID="objTest" APPLICATIONNAME="HTATest" SCROLL="no" SINGLEINSTANCE="yes" >
</head>
<SCRIPT LANGUAGE="VBScript">
<!--
-->
</SCRIPT>
<body>
<input type="file" id=FILE>
</body>