我想使用批处理文件从文本文件中读取,然后将字符串传递给vbscript vbs将显示文本信息。
我能够阅读但无法显示
这是批次代码
Option Explicit
Dim InputFile
Dim FSO, oFile
Dim strData
InputFile = "C:\Users\admin\Desktop\output.txt"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set oFile = FSO.OpenTextFile(InputFile)
strData = oFile.ReadAll
SET AvayaContent1=strData
START c:\windows\system32\wscript.exe c:\users\admin\Desktop\ScreenPopMessage.vbs
这是vbs代码
Set wshShell = CreateObject( "WScript.Shell" )
MemID = wshShell.ExpandEnvironmentStrings( "%AvayaContent1%" )
WScript.Echo MemID
欢迎任何想法:)
答案 0 :(得分:1)
这一切都可以进入一个vbs脚本。
'bat文件
call "c:\users\admin\Desktop\ScreenPopMessage.vbs"
'vbs文件
Option Explicit
Dim InputFile
Dim FSO, oFile
Dim strData
InputFile = "C:\Users\admin\Desktop\output.txt"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set oFile = FSO.OpenTextFile(InputFile)
strData = oFile.ReadAll
oFile.Close
WScript.Echo strData
set FSO = nothing
set oFile = nothing
答案 1 :(得分:0)
解决!! 谢谢Sorceri的帮助
为了使用从Avaya IP代理应用程序传递的数据以及文本文件数据,我修改了以下代码
BAT文件
SET AvayaContent1=%1
START c:\windows\system32\wscript.exe c:\users\admin\Desktop\ScreenPopMessage.vbs
和vbs脚本文件
Set wshShell = CreateObject( "WScript.Shell" )
UserID = wshShell.ExpandEnvironmentStrings( "%AvayaContent1%" )
Dim InputFile
Dim FSO, oFile
Dim strData
InputFile = "c:\users\admin\Desktop\output.txt"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set oFile = FSO.OpenTextFile(InputFile)
strData = oFile.ReadAll
oFile.Close
set FSO = nothing
set oFile = nothing
intButton = WshShell.Popup ("User ID: " + UserID + " Agent ID: " + strData, 0, " Avaya Caller Screen Pop ", 0 + 64)