borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (HOW TO RUN INTERNET EXPLORER WITH SPECIFIC WEBSITE ADDRESS)Next Topic (How many times substring occurs in string?) New Topic New Poll Post Reply
AndreaVB Forum : API : edit text file running shell batch script
Poster Message
Clyde
Level: Graduate

Registered: 07-08-2005
Posts: 9

icon edit text file running shell batch script

Is there a way to directly edit a .txt file using the shell command, Now I have a button pointing to a certian batch file to edit the .txt file. What I am looking to do is to skip the batch file.

Here is the shell command I am using on a button called EDIT is...

Private Sub Command4_Click()
Dim RetVal
intpress = MsgBox("Are you sure you want to edit the SOURCE data?", vbQuestion + vbYesNo, "Source File")
If intpress = vbNo Then
Else
RetVal = Shell("c:\Data.bat", 1)
End If
End Sub

The Batch file is....

@echo off
edit c:\data.TXT
exit";

Thanks...
Clyde

17-09-2005 at 05:07 PM
View Profile Send Email to User Show All Posts | Quote Reply
TJ_01
Level: VB Lord


Registered: 24-08-2005
Posts: 320
icon Re: edit text file running shell batch script

Try to load the content of your batch file in the RichTextBox Control.

Private Sub Command1_Click()
   RichTextBox1.LoadFile "c:\YourBatchFileName.bat"
End Sub


And from there, you can edit and save it as .bat

HTH

____________________________
Im JAMES  

28-10-2005 at 03:42 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : API : edit text file running shell batch script
Previous Topic (HOW TO RUN INTERNET EXPLORER WITH SPECIFIC WEBSITE ADDRESS)Next Topic (How many times substring occurs in string?) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder