I am using a command line version of resize.exe (a program to resize images)
I am trying to create a simple HTA application that will receive user input and pass it to a CMD. The problem here is that my batch script is failing when placing it in the VBS.
Am I escaping this wrong or is there something else that needs to be added?
<html>
<head>
<title>HTA Test</title>
<HTA:APPLICATION 
 ID="objTest" 
 APPLICATIONNAME="HTA Test"
 SCROLL="no"
 SINGLEINSTANCE="yes"
>
</head>
<SCRIPT LANGUAGE="VBScript">
Sub TestSub
    Dim height
    Dim width
    height = h.Value
    width = w.Value
    myCMD = "CMD for /r ""C:\hta\photos\"" %%X in (*) do (""C:\hta\resize.exe"" -i""C:\hta\photos\%%~nX%%~xX"" -o""C:\hta\resized\%%~nX%%~xX"" -s800x600) PAUSE"
    Set WshShell = CreateObject("WScript.Shell")
    WshShell.exec(myCMD)
End Sub
</SCRIPT>
<body>
Width <input type="text" name="w" size="10" value="320"><br>
Height <input type="text" name="h" size="10" value="240"><br>
<input type="submit" name="" value="sub" onClick="TestSub">
</body>
				
                        
Here is the HTA that can write the batch file and execute it :