Results 1 to 15 of 15

Thread: Is there a way to do this?

  1. #1

    Thread Starter
    New Member Masta's Avatar
    Join Date
    Aug 2003
    Posts
    13

    Is there a way to do this?

    Open the command line and type in something and hit the enter button with coding?

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Yes

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Use process obj , set its file name property , set arguments . Start it .

  4. #4

    Thread Starter
    New Member Masta's Avatar
    Join Date
    Aug 2003
    Posts
    13
    I'm kinda lost with the Process Object and Argument Could you give me an example of what you mean?

    thanks alot

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Something like this but it doesn't work for some reason . I mean it doesn't send the arguments . I don't know what I'm missing here .
    VB Code:
    1. Dim proc As New Process
    2. proc.StartInfo.FileName = "CMD.EXE"
    3.  proc.StartInfo.Arguments = "cd.."
    4.  proc.Start()

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    This works fine . It uses the string assigned to arguments property .
    VB Code:
    1. Dim proc As New Process
    2.         proc.StartInfo.FileName = "IEXPLORE.EXE"
    3.         proc.StartInfo.Arguments = "www.blah.com"
    4.         proc.Start()

  7. #7

    Thread Starter
    New Member Masta's Avatar
    Join Date
    Aug 2003
    Posts
    13
    can you do that in a dos based program though?

    Where you have to send 3 arguments right after another?

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by Masta
    can you do that in a dos based program though?

    Where you have to send 3 arguments right after another?
    You mean .bat files ? you don't want to write that in VB.NET ??

  9. #9

    Thread Starter
    New Member Masta's Avatar
    Join Date
    Aug 2003
    Posts
    13
    ok I need to take and send 3 commands in dos to a program to change something - Will it be easier with a bat file or .net code?

  10. #10
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by Masta
    ok I need to take and send 3 commands in dos to a program to change something - Will it be easier with a bat file or .net code?
    It depends on the thing you are implementing ??

  11. #11

    Thread Starter
    New Member Masta's Avatar
    Join Date
    Aug 2003
    Posts
    13
    well I am trying to change my Static IP of a Network without all the hassle of going to the Network connection.. and changing it that way


    thats why I was trying to make a Program to go and do it for me....

  12. #12
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    OK , if it's DOS Command it's easier to use .bat files . It'll execute the command and closes the DOS window . Can you send me that command ?I've tried this but it gives error about DHCP . I think it's not applicable when getting online .

    IPCONFIG/renew

  13. #13

    Thread Starter
    New Member Masta's Avatar
    Join Date
    Aug 2003
    Posts
    13
    you have to open (netsh) then type in (interface) hit enter then type in (ip) hit enter then type in (set address "connection" static IP address Subnet Mask) hit enter

    thank you so so much

  14. #14
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I really forgot how to write a working batch file . That was in Win98 days (3 years ago) . Anyhow , see the links if they can offer better help than me .http://www.robvanderwoude.com/index.html . I made a batch file and can execute netsh but I don't know how to get the next command . simulate enter key press .

  15. #15
    Junior Member
    Join Date
    Oct 2008
    Posts
    18

    Re: Is there a way to do this?

    hello,
    I need to send parameter to command prompt how can i do that ,i have tried
    your code its opening command prompt but the command is not getting executed any suggestions...
    1. Dim proc As New Process
    2. proc.StartInfo.FileName = "cmd.exe"
    3. proc.StartInfo.Arguments = "d:"
    4. proc.Start()

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