Loading Library at Run time (.vbs file)
Hi,
I want to laod .vbs file using script.
For e.g my test is open, i have abc.vbs file that is not attached till now. so i want to make general function which will load that .vbs file into Test setting -> Resources -> loading that .vbs file from particular path
[This question was asked by Jitesh Sojitra....]
Re: Loading Library at Run time (.vbs file)
[QUOTE=psuresh1982;7196]Hi,
I want to laod .vbs file using script.
For e.g my test is open, i have abc.vbs file that is not attached till now. so i want to make general function which will load that .vbs file into Test setting -> Resources -> loading that .vbs file from particular path
[This question was asked by Jitesh Sojitra....][/QUOTE]
here is the sample code ...
dim index as integer
index = Shell(path, AppWinStyle.Normal, True)
Dim ShellProcess as new Process
Try
ShellProcess.StartInfo.FileName = path
ShellProcess.StartInfo.UseShellExecute = True
ShellProcess.Start()
ShellProcess.WaitForExit()
Catch....
Finally
ShellProcess.Dispose()
End Try
Let me know if this helps...
Thanks,
Suji
Re: Loading Library at Run time (.vbs file)
another way of doing in old vb way if you don't want to use process object from vb.net ...
dim WShShell, RetCode
Set WShShell = Server.CreateObject("WScript.Shell")
RetCode = WShShell.Run("C:\TEST.vbs",1, True)
response.write RetCode
set WShShell = nothing