Results 1 to 5 of 5

Thread: Using VB.net to open other programs

  1. #1
    Variable Bitrate
    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 : )

  2. #2
    FLAC PatO's Avatar
    Join Date
    Dec 2000
    Location
    Afton MN
    Posts
    1,120
    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!
    http://www.jeepmp3.com/
    CarPC Stolen. Starting over.
    Ne1 recognize the avatar?

  3. #3
    Variable Bitrate
    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.

  4. #4
    Retired Admin Aaron Cake's Avatar
    Join Date
    Jan 2000
    Location
    London, Ontario, Canada
    Posts
    2,464
    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."

  5. #5
    Variable Bitrate
    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •