Results 1 to 7 of 7

Thread: exucte Command Prompt in fourm

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    9

    exucte Command Prompt in fourm

    Guy's

    I want to execute come command like ipconfig from my form as Command Prompt

    Can any one help me in this ..

    From Picture tool or Text tool .. Pls advice ..

  2. #2
    Hyperactive Member
    Join Date
    Jun 2009
    Posts
    441

    Re: exucte Command Prompt in fourm

    vb Code:
    1. Dim sMyCommand as String
    2. sMyCommand  = "ipconfig"
    3. Shell "cmd /c " & sMyCommand , vbHide

  3. #3
    Hyperactive Member
    Join Date
    Jun 2009
    Posts
    441

    Re: exucte Command Prompt in fourm

    This code is supposed to launch the command prompt with a hidden way (cuz there is the attribute vbhidden), and it will launch the ipconfig (or any other command dos you type in the sMyCommand)
    In case you need to see the dos command prompt than don't use the vbhide

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    9

    Re: exucte Command Prompt in fourm

    its not working with me .. in which mode I have to run it ?

    can you please show me ..

  5. #5
    Hyperactive Member
    Join Date
    Jun 2009
    Posts
    441

    Re: exucte Command Prompt in fourm

    I am sure that it's working, but it's hidden so you don't see it !!!! You said you want to be able to launch the command that you can excecute from VB and i told you how !! now it depends on your command, the code I gave you works fine !!!

    Try from your vb things like the following and you will see that it's working !!



    vb Code:
    1. Shell ("calc.exe") 'to run calculator
    2. Shell ("cmd.exe") 'to run command prompt
    3. or
    4. Shell "C:\Windows\system32\cmd.exe", vbNormalFocus  'to run command prompt with a different way

  6. #6
    Hyperactive Member
    Join Date
    Jun 2009
    Posts
    441

    Re: exucte Command Prompt in fourm

    if you still consider it not working, than maybe I didn't understand your needs I am sorry and I hope that someone else will get exactly what you want and that will provide necessary help

  7. #7
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: exucte Command Prompt in fourm

    this execute ipconfig/all, u can change the commands, justgreat already posted for u.
    Code:
    Private Sub Command1_Click()
    Shell "cmd.exe /k ipconfig/all", vbNormalFocus
    End Sub
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


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