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 Black Friday Deals 2017

How modern book design was influenced by illustrated manuscripts

Best Black Friday Apple Deals 2017

Les meilleurs logiciels de montage vidéo gratuits (en 2017)