Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

How to execute *.mst (scripts) in visual basic ?

Hey,
        Can someone tell me how to run *.mst (script files) through code. The mst file was written in Rational Visual Test and I need to know how to execute that file through code in VB. Please answer as soon as possible. Thanks in advance.
0
gohulanb
Asked:
gohulanb
1 Solution
 
Ryan ChongCommented:
Try use ShellExecute API?

Example:

Public 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

Public Function StartDoc(ByVal FileName As String, Optional CommandLine As String = "") As Long
    StartDoc = ShellExecute(0&, "Open", FileName, CommandLine, vbNullString, 1)
End Function

then use like:

StartDoc "c:\test.mst"

Let me know if it's not working, regards
0
 
NetminderCommented:
PAQed - no points refunded (of 125)

Netminder
Site Admin
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now