Results 1 to 3 of 3

Thread: How can I start the command prompt...

  1. #1

    Thread Starter
    Addicted Member killer_cobra's Avatar
    Join Date
    Jun 2001
    Location
    Lost in space
    Posts
    131

    Question How can I start the command prompt...

    Hi,
    Just wondering if there is a way to start the command prompt (cmd.exe, Win2K), input a command with switches (-a, /s, etc.) and execute it from my program?
    It would also be a big help if there was a way to keep the window open. (The results of the command appear in the window of cmd.exe, but it will close if done from the RUN applet.) My program is a front end to a Console application.

    I have given myself a headache trying to figure it out, so any help is VERY much appreciated!!

    Thanks,
    Scott

  2. #2
    Junior Member
    Join Date
    Jun 2001
    Location
    France
    Posts
    21

    By using

    Just use the Shell command
    But the window won't stay open after the end of the process

    Shell MyPrompt,Constant
    where MyPrompt is a string containing your command line
    ex : "c:\program files\MyDosApp\MyDosApp.exe -a -b -c"
    You will be prompted the possible values for Constant after typing the ,

    or use
    Dim dummy as long
    dummy=Shell(MyPrompt,Constant)

    This works the same, I don't know the difference

    BTW, I also give myself headaches trying to make a graphical interface
    Black Rose of the Artist Clan

  3. #3
    Addicted Member Michael Woolsey's Avatar
    Join Date
    Nov 2000
    Location
    Calgary, Alberta, Canada.
    Posts
    243
    Actully shell doesn't have to return anything if you aren't concerned if it was a successful load or not...

    You could do:
    VB Code:
    1. Shell "c:\windows\notepad.exe", vbNormalFocus
    Michael
    Application/Web Developer

    Visual Basic 6.0 SP5
    Active Server Pages
    Oracle 9i
    - I'm going to live forever, or die trying!

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