Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

output data to file

Status
Not open for further replies.

Hugo Jesus

Technical User
Jul 10, 2017
1
PT
hello everyone, could someone help me in complete this? I am newbie in vbscript.
I have this code below that works fine, however it's possible to output the text to a file .txt or in preference to xml file?
Basically what this does, it's open an external program... insert a code and press F18 to check available stock. Then I would like to send the information to xml file or other format that I could work. Don't need to parse anything, could send the text as is to a file.
I couldn't find too much examples on internet or I don't really find how to search exactly.



'VBScript Example
Set WshShell = WScript.CreateObject("WScript.Shell")



Sub goToNext()
WScript.Sleep 1000
WshShell.SendKeys "+{F6}"
End Sub


Sub multipleTab(value)
Dim tab
tab = 1

While tab < value
WshShell.SendKeys "{TAB}"
tab=tab+1
Wend
End Sub



If WshShell.AppActivate("TAP HostSystem") Then


WshShell.SendKeys "H301AKM1"
goToNext()


End If
 
Basic Example...

Set objFSO=CreateObject("Scripting.FileSystemObject")

' How to write file
outFile="c:\test\autorun.inf"
Set objFile = objFSO.CreateTextFile(outFile,True)
objFile.Write "test string" & vbCrLf
objFile.Close


Simi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top