VB6 - creating files

  philip-202608 15:12 19 Dec 05


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.

How to get Windows 10 for free | How to install Windows 10: There is still a way to avoid paying…

1995-2015: How technology has changed the world in 20 years

Alex Chinneck’s giant ice cube Christmas tree at Kings Cross

Apple rumours & predictions 2017: The iPhone 8, new iPads, and everything else you should expect fr7…