VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Ever wanted to launch another program from a CD? If you need to use your program from a CD, and lau

by Sam Witney (7 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 20th December 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Ever wanted to launch another program from a CD? If you need to use your program from a CD, and launch other programs from it, on the same CD,

API Declarations


'Just place the code in any Sub, or any point in your program, a command button for example.

Rate Ever wanted to launch another program from a CD? If you need to use your program from a CD, and lau



drvletter$ = Left(App.Path, 1) ' finds the drive letter, the letter 1st left from the app path.
direct$ = ":\windows\notepad.exe" ' replace with the program path of your choice
Path$ = drvletter$ & direct$ ' makes the full path, ready to be used to shell the program
On Error GoTo loaderror ' tells the program to go to the loaderror (see below) if there is an error

Shell Path$, vbMaximizedFocus ' this will load the program, maximised and with the focus - ie active. change as needed.

Exit Sub
loaderror: ' the program jumps to here if there is an error, avoiding the program crashing.
MsgBox Err.Number & " " & Err.Description, vbCritical, "Error" ' message to user

Download this snippet    Add to My Saved Code

Ever wanted to launch another program from a CD? If you need to use your program from a CD, and lau Comments

No comments have been posted about Ever wanted to launch another program from a CD? If you need to use your program from a CD, and lau. Why not be the first to post a comment about Ever wanted to launch another program from a CD? If you need to use your program from a CD, and lau.

Post your comment

Subject:
Message:
0/1000 characters