DOS command prompt

  • 15 years ago

    Does anyone know how to implemet a .exe from inside VB6? I need to use a utility that prints a txt file to a dot matrix printer.

  • 15 years ago
    You can use ShellExecute

    Private 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

    That is the defination.

    To use it:
    Private Const SW_SHOWNORMAL = 1

    lngRC = ShellExecute(hwnd, "open", strLink, "", "", SW_SHOWNORMAL)

  • 15 years ago
    Thanks for that, works great!

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“If Java had true garbage collection, most programs would delete themselves upon execution.” - Robert Sewell