-
November 12th, 2001, 03:55 PM
#1
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.
Sree
-
November 12th, 2001, 05:14 PM
#2
Re: Calling a VB Script file from VisualBasic
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
Kris
Software Engineer
Phoenix, AZ USA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|