回复 8# xgda
对象“a”是你的代码中定义的“ CreateObject("Wscript.Shell")”,可能你把对象名称“a”改成了“objWshShell” 。试试:- Dim objWshShell, objFSO, objTextStream
- Set objWshShell = CreateObject("Wscript.Shell")
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- Set objTextStream = objFSO.OpenTextFile("C:\log.txt", 1, False)
-
- Dim strTextLine, i, strKey
- strTextLine = objTextStream.ReadLine()
- If Not strTextLine = "" Then
- For i = 1 To Len(strTextLine)
- strKey = Mid(strTextLine, i, 1)
- If ASC(strKey) > 0 And ASC(strKey) < 127 Then
- objWshShell.SendKeys strKey
- End If
- Next
- End If
-
- Set objWshShell = Nothing
- Set objFSO = Nothing
复制代码
|