launching a program using its registry entry NOT Shell() 
Author Message
 launching a program using its registry entry NOT Shell()

hi,

I have a script that launches an external program using the Shell() function.  It works great on a few computers that have it implemented but the problem is that I have the path to the executable hard
coded.  I was told that I its possible to launch a program from its registry entry.  I've been searching for a while now and can't seem to find it.  Can any one help me out?  

Here's what I have in my script that works good.  This script is run from within a software package that has vb scripting support so thats why some code is also in there.

Function PrintScreen (ApplHndl As Long,SelectOp As String,Reclst1 As Long,Reclst2 As Long,Reclst3_
 As Long ) As Integer

        id = Shell("d:\program files\snagit\snagit32.exe /s",1)

End Function

thanks in advance for anyone who could help me out,

steve

--
Stefo D. Stojanovski
CADimensions, Inc.

http://www.*-*-*.com/
Tel: 315-434-9787
Fax: 315-434-9782



Wed, 18 Jun 1902 08:00:00 GMT  
 launching a program using its registry entry NOT Shell()
It's fairly easy. You look up the extension in the registry as a key name
under HKEY_CLASSES_ROOT, the default string value there is the file type
description, take the file description and find the key (again under
HKEY_CLASSES_ROOT) with that name. Under *that* key you'll typically find a
key called Shell, and under that key you will find all the actions possible
for that file type. Under each action, you will find a key called command.
The default string value there specifies the appropriate command line for
that type of file and that action with a %1 marking the spot where the full
path and filename should be placed.

Browse this area of the registry with regedit and you'll see what I mean.

Steve



Quote:
> hi,

> I have a script that launches an external program using the Shell()

function.  It works great on a few computers that have it implemented but
the problem is that I have the path to the executable hard
Quote:
> coded.  I was told that I its possible to launch a program from its

registry entry.  I've been searching for a while now and can't seem to find
it.  Can any one help me out?
Quote:

> Here's what I have in my script that works good.  This script is run from

within a software package that has vb scripting support so thats why some
code is also in there.
Quote:

> Function PrintScreen (ApplHndl As Long,SelectOp As String,Reclst1 As

Long,Reclst2 As Long,Reclst3_
Quote:
>  As Long ) As Integer

> id = Shell("d:\program files\snagit\snagit32.exe /s",1)

> End Function

> thanks in advance for anyone who could help me out,

> steve

> --
> Stefo D. Stojanovski
> CADimensions, Inc.

> http://www.cadimensions.com
> Tel: 315-434-9787
> Fax: 315-434-9782



Wed, 18 Jun 1902 08:00:00 GMT  
 launching a program using its registry entry NOT Shell()

Quote:
> I was told that I its possible to launch a program from its
> registry entry.

Probably true, but not all programs have Registry entries -- how
would you launch those?  :)

Regards, Otser.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Registry read Failure when program launched by AT scheduling program

2. enumerate registry entries using win32api registry functions

3. Program not closing using Shell command

4. VB5 and Shelling a DOS program...Used to use getmoduleusage but not for 32bit

5. shell program launch with file?

6. VB3 shell() launches another copy same program...

7. determine if a program launched with the shell function completed

8. Registry Entries outside of VB and VBA Program Settings

9. registry key entry for running a program as admin

10. how to search registry for autoload program entry?

11. How do I add a Registry entry into 95/98 using vb6

12. launch application using registry??

 

 
Powered by phpBB® Forum Software