晕 vb6.0 shell 不能调用自己打开的bat文件, 源码如下:
PrivateSubForm_Load()DimaAsStringDimfnAsStringSetfs=NewFileSystemObjectOnErrorGoToera...
Private Sub Form_Load()
Dim a As String
Dim fn As String
Set fs = New FileSystemObject
On Error GoTo er
a = fs.GetFolder("i:/now9")
If a <> "" Then
MsgBox "!!!"
Exit Sub
End If
er:
fn = "corton" & Date & Time
Open "i:/creatfolder.bat" For Append As #1
Print #1, "@echo off"
Print #1, "copy t1 now"
Print #1, "echo true>flag.txt"
Print #1, "pause"
Close #1
' 下面这句是关键
Shell "i:/creatfolder.bat"
End Sub 展开
Dim a As String
Dim fn As String
Set fs = New FileSystemObject
On Error GoTo er
a = fs.GetFolder("i:/now9")
If a <> "" Then
MsgBox "!!!"
Exit Sub
End If
er:
fn = "corton" & Date & Time
Open "i:/creatfolder.bat" For Append As #1
Print #1, "@echo off"
Print #1, "copy t1 now"
Print #1, "echo true>flag.txt"
Print #1, "pause"
Close #1
' 下面这句是关键
Shell "i:/creatfolder.bat"
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询