VB6 - creating files

  philip-202608 15:12 19 Dec 05
Locked

situation:

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)


[quote]
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
[/quote]



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

problem:

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

help!

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

Sony Xperia XZ Premium review: Hands-on with the new 4K HDR phone with Motion Eye camera and Snapdr5…

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

Best laptop for design and art 2017: we test Apple, Dell, HP, Lenovo and Microsoft's most powerful…

Apple Watch 2 vs Huawei Watch 2 comparison review: watch out for 4G smartwatches Apple