Could you any one give me hint on steps to RUN a VBScript (.vbs) file from a VisualBasic DLL. I dont want to wait for the response back.
Any help in this regard is appreciated.
Sree
Printable View
Could you any one give me hint on steps to RUN a VBScript (.vbs) file from a VisualBasic DLL. I dont want to wait for the response back.
Any help in this regard is appreciated.
Sree
try this
public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (byval hwnd as Long, byval lpszOp as string, byval lpszFile as string, byval lpszParams as string, byval lpszDir as string, byval FsShowCmd as Long) as Long
public Declare Function GetDesktopWindow Lib "user32" () as Long
public Function ExecuteFile(strCmdLine as string, optional strParams as string)
Dim Scr_hDC as Long
on error resume next
'//Execute A File
Scr_hDC = GetDesktopWindow()
ExecuteFile = ShellExecute(Scr_hDC, "Open", strCmdLine, strParams, "C:\", SW_SHOWNORMAL)
End Function
private Sub CreateShortcut()
'//Create Shortcut on Desktop
ExecuteFile ("C:\WI Applications\Shortcuts.vbs")
End Sub
Just pass in the command line and any parameters
Kris
Software Engineer
Phoenix,AZ