|
 |
11-22-2002, 11:08 PM
|
#1
|
|
Registered User
Join Date: Sep 2002
Location: Worcester, MA
Posts: 252
|
Using VB.net to open other programs
I am throwing together a custom interface to run all my stuff, and i have having the hardest time trying to figure out what code will allow me to "when i hit button x, program x runs"
I am trying to have it so when i click on MP3, winamp starts up. Ive been messing with VB for about an hour now, searching msdn, and google, and i just cant seem to find a peice of code that works to do, what i imagine, is a very simple operation.
anyone have an idea on how to do this? i am stuck : )
|
|
|
|
|
|
Advertisement
|
Sponsored links
|
11-23-2002, 01:20 AM
|
#2
|
|
FLAC
Join Date: Dec 2000
Location: Afton MN
Posts: 1,119
|
Piece of cake!
You're looking for the Tools.Shell command. Here's the page I found: http://msdn.microsoft.com/library/de...ellcommand.asp
Oh, nice. vBulletin truncated the visual for the link to ...hellcommand. Don't worry - it is a legitimate link!
Last edited by PatO; 11-23-2002 at 01:23 AM.
|
|
|
11-23-2002, 09:10 AM
|
#3
|
|
Registered User
Join Date: Sep 2002
Location: Worcester, MA
Posts: 252
|
awesome, thats just what i was looking for, however, using the tools.shell syntax didnt work, it underlined tools saying it wasnt defined or something like that. I found an alias page here http://msdn.microsoft.com/library/de...inealiases.asp
and it gave me the alias for it which is just shell, and then the code that follows from the text.shell page.
Hope that helps anyone else having the same problem.
|
|
|
11-23-2002, 09:32 AM
|
#4
|
|
Retired Admin
Join Date: Jan 2000
Location: London, Ontario, Canada
Posts: 2,465
|
Try this:
Dim X As Long
X=Shell ("C:\WINDOWS\Mplayer.exe", 1)
Should fire up Media Player. Now replace the section in quotes with the path to your WinAmp EXE. If you want to add command line arguments, it is best to use short filenames.
__________________
Player: Pentium 166MMX, Amptron 598LMR MB w/onboard Sound, Video, LAN, 10.2 Gig Fujitsu Laptop HD, Arise 865 DC-DC Converter, Lexan Case, Custom Software w/Voice Interface, MS Access Based Playlists
Car: 1986 Mazda RX-7 Turbo (highly modded), 1978 RX-7 Beater (Dead, parting out), 2001 Honda Insight
"If one more body-kitted, cut-spring-lowered, farty-exhausted Civic revs on me at an intersection, I swear I'm going to get out of my car and cram their ridiculous double-decker aluminium wing firmly up their rump."
|
|
|
11-23-2002, 09:37 AM
|
#5
|
|
Registered User
Join Date: Sep 2002
Location: Worcester, MA
Posts: 252
|
well,
Shell """c:\Program Files\SomeFile.exe""" works fine for me. For some reason the msdb website says you need 3 sets of quotes, but it works fine.
The problem i had was when you put tools.shell "whatever"... it gives me the msg "Name "Tools" not declared"
but since i got it to work with just shell "whatever" i think im good
thanks for your help
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:00 AM.
| |