求人帮我写个简单的VB程序

来源:百度知道 编辑:UC知道 时间:2024/05/08 21:05:48
这是我前面的问题,已经得到答案!
http://zhidao.baidu.com/question/43006179.html
但是我又有个想法,如果我在ini(或者txt)文件里面写2个或2个以上需要执行的程序要怎么改写那个VB语言?比如:我在ini里面第一行写:e:\播放列表1.wpl 第2行写:e:\start.bat 要运行这个exe文件能同时执行这2个(或者2个以上的命令)该怎么能?

把你的程序全部替换成这个
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Sub Main()
Dim fName As String
Dim hwnd As Long
Open App.Path & "\Pro.ini" For Input As #1
While Not EOF(1)
Line Input #1, fName
ShellExecute hwnd, "open", fName, vbNullString, vbNullString, 1
Wend

Close #1

End Sub