Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 686

[RESOLVED] variable undefined objshell

$
0
0
i am making an .hta app with vbscript primarily along with using a .vbs file and two batch files.. everything is working good except after doing some fixes for other stuff; i am getting an error that objshell is undefined when attempting to write a text box to "input.txt"

"set objshell = createobject("wscript.shell")" is where the problem is.
please help i am new



HTML Code:

<script language="vbscript">
option explicit
        Const ForWriting = 2

        Dim objFSO, objFile, strFileName
        strFileName = "input.txt"
    Set objFSO = CreateObject("Scripting.FileSystemObject")
       
        Set objFile = objFSO.OpenTextFile(strFileName, 2, true)
Set objshell = CreateObject("WScript.Shell")

Sub Submitarea
  Set objFile = objFSO.OpenTextFile(strFileName, 2, True)
  objfile.Write TextFile.Value
  objFile.Close
  MsgBox "Your text has been added to " & strFileName, 64, "Textarea Input"

End Sub
</script>       
        <textarea name="TextFile" id="TextFile" rows="20" cols="50"></textarea>
       
        <input type="button" value="Submit" onclick="Submitarea">


Viewing all articles
Browse latest Browse all 686

Trending Articles



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