Results 1 to 11 of 11

Thread: How can i start a program from VB?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    8

    Post

    I have a button, (Command1) and i want to start notpad, by clicking this button.
    But I don't want to use, the command: shell
    So how can i start notepad without using MSDOS, or any other program by clicking this button ? Thanx

  2. #2
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Post

    Wanna use API?
    By the way, why don't you want to use Shell?
    HTH

    ------------------
    Visual Basic Programmer
    ------------------
    PolComSoft
    You will hear a lot about it.


  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    8

    Post

    well, i dont want to use shell cause, thay disabled MS DOS at my school, and i want to use this VB project at school.

  4. #4
    New Member
    Join Date
    Jan 2000
    Location
    Grand Rapids, Michigan, USA
    Posts
    12

    Post

    There is actually a good project at http://visualbasic.about.com where you build a text editor in vb... complete with load and save functions, cut, paste, copy, etc...

    Check it out:
    http://visualbasic.about.com

  5. #5
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    I must be missing something...what has Shell got to do with DOS?

  6. #6

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    8

    Post

    whell when u use shell, it opens up a dos box, and thats the problem

  7. #7
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    Err...are you sure? I've never encountered a DOS box. What does the DOS box say (if anything)? Does the program you shelled still execute?

    Of course this could happen on versions other than 6 (the only one i know )

  8. #8
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Post

    I don't think Shell has anything to do with DOS either.

    ------------------
    Visual Basic Programmer
    ------------------
    PolComSoft
    You will hear a lot about it.


  9. #9

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    8

    Post

    can u give me an example using the shell command ?

  10. #10

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    8

    Post

    never mind, i already got it:

    Call Shell("c:\windows\notepad.exe", vbNormalFocus)

    thanx.

  11. #11
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Leeds, UK
    Posts
    287

    Post

    Shell only opens up a dos dialog box if you're opening a dos program with the shell command.

Posting Permissions

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



Click Here to Expand Forum to Full Width