• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 153
  • Last Modified:

Launch an app via a shortcut from VB?

How do I call a shortcut from within VB?  This would be the equivalent of typing "c:\app.lnk" at the DOS prompt.  The reason I want to do this is to force a 16-bit app to run in a separate memory space, as can be specified in the shortcut properties.  Is there another way to tell an app to run in a separate memory space?  I'm working on NT4.
0
craigdawson
Asked:
craigdawson
  • 3
  • 2
1 Solution
 
ninooCommented:
shell function will help you

example
  shell("notepad.EXE", 1)
0
 
mcriderCommented:
You can run a .lnk file using ShellExecute.  See the microsoft KB article:

HOWTO: Use ShellExecute to Launch Associated File (32-bit)
http://support.microsoft.com/support/kb/articles/Q170/9/18.asp 
 
Cheers!

0
 
mcriderCommented:
ninoo,

shell will not launch .lnk file...

Cheers!
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
craigdawsonAuthor Commented:
Shell doesn't do it.  ShellExecute API looks promising, though.  Thanks.
0
 
ninooCommented:
i am sorry about it mcrider
0
 
mcriderCommented:
in the URL I gave there is a function defined called StartDoc(DocName As String)

It uses the ShellExecute API.  You can use it to call StartDoc this way:

   StartDoc("C:\windows\mylink.lnk")

and the link will execute...


Cheers!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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