November 12th, 2001, 03:55 PM
Calling a VB Script file from VisualBasic
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.
November 12th, 2001, 05:14 PM
Re: Calling a VB Script file from VisualBasic
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)
private Sub CreateShortcut()
'//Create Shortcut on Desktop
ExecuteFile ("C:\WI Applications\Shortcuts.vbs")
Just pass in the command line and any parameters
Phoenix, AZ USA
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!