|
-
Oct 20th, 2000, 09:49 AM
#1
Thread Starter
Lively Member
I am Trying to write to a text file but It keeps adding quotes to my statement. It is a command and won't run with qoutes around it.
It looks like this "nbtstat -a >""c:\output.txt"""
It is supposed to look like this nbtstat -a >"c:\output.txt"
Here is my code.
Private Sub Command1_Click()
'Form Contains Text2, Text1, RichTextBox1, and Command1
Dim MyCommand As String
Dim ComputerName As String
Dim Test As String
'The Computer You Want Info About.
ComputerName = Text1.Text
'Strings the NBTSTAT command with the Computer Name and an Output File.
MyCommand = "nbtstat -a " & computer & " >" & Chr(34) & "c:\output.txt" & Chr(34)
'Moves the Command to the Test Varible
'Then to The Text2 text box to Check Formatting
Test = MyCommand
Text2.Text = Test
'Writes the Command to a Batch File
Open "C:\Command.bat" For Output As #1
Write #1, Text2.Text
Close #1
'Runs the Batch File
Shell "C:\Command.bat", vbHide
'Recieves an Error Because The Batch File Contains Too Many Quotes
'And the Output File hasn't Been Created
RichTextBox1.FileName = "C:\Output.txt"
End Sub
Thanks for any help
Brandon
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|