VB6 - creating files

  philip-202608 15:12 19 Dec 2005


creating a VB6 project that will take input from the user from two text boxes, then save this input to a batch file and then run the batch file in the background (vbhide)

Private Sub sendbtn_Click()
Dim task As Integer
Write #1, lbl_netsend.Caption & " " & IP_text.Text & " " & msg_text.Text
Close #1
task = Shell("spam.bat", vbHide)
End Sub
Private Sub Form_Load()
Dim filename As String
filename = App.Path & "\spam.bat"
Open filename For Output As #1
End Sub

thats the code so far

lbl_netsend is just a invisible label saying net send
IP_text is where you add the IP/Computer name or a * to send to a the current workgroup
msg_text is where you add the message

Output intended:

spam.bat with

Net send IP_text Msg_text on the first line


first line has speech marks surrounding the text which stops the batch file working properly...


This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Best phone camera 2017

Stunning new film posters by Hattie Stewart, Joe Cruz & more

iPad Pro 10.5in (2017) review

28 astuces pour profiter au mieux de votre iPhone