Results 1 to 3 of 3

Thread: Shell command

  1. #1

    Thread Starter
    Hyperactive Member MetallicaD's Avatar
    Join Date
    Feb 2001
    Location
    Tallahassee, FL
    Posts
    488

    Shell command

    Hello all.. I am looking for the easist way to do a shell command.. basically, I want to do a Net Send.. i am converting a program from VB6 to .NET and would like to use the framework as much as possible. In the old program, i just issued the shell command and avoided the APIs.. do i need to use the APIs in .net or is something built in.. if not, can I shell it, and how do i do so..

    thanks,
    -mcd
    [vbcode]
    '*****************************
    MsgBox "MCD :: [email protected]", vbInformation + vbOKOnly, "User"
    '*****************************
    [/vbcode]

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    something like system.diagnostics.process("net blah")

    probably not correct,but close.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Hyperactive Member MetallicaD's Avatar
    Join Date
    Feb 2001
    Location
    Tallahassee, FL
    Posts
    488
    Cander.. thanks for responding to my thread.. can always count on you for a response..

    starting a process doesnt work in this situation.. i just used the same old thing from VB6 (Shell command) in the mean time until i can see if the framework has something better for me... here is my code:

    VB Code:
    1. Private Function SendMessage(ByVal v_To As String, ByVal v_Message As String) As Boolean
    2.  
    3.         Try
    4.             Shell(String.Format("net send {0} {1}", v_To, v_Message))
    5.             SendMessage = True
    6.         Catch e As Exception
    7.             SendMessage = False
    8.         End Try
    9.  
    10.     End Function

    thanks for the suggestion!
    -mcd
    [vbcode]
    '*****************************
    MsgBox "MCD :: [email protected]", vbInformation + vbOKOnly, "User"
    '*****************************
    [/vbcode]

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