Results 1 to 9 of 9

Thread: shell command in vb 6.0 what in vb.net

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    india
    Posts
    273

    shell command in vb 6.0 what in vb.net

    dear all,

    I want to run an exe from my vb.net windows form what is replacement of shell command(in vb 6.0) in vb.net

    help appreciated !!

    thanks & regards

    ppcc

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Simply this ,
    VB Code:
    1. Process.Start("notepad.exe")

  3. #3
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    actually, the "shell" command works too. Is it better to use the process.start?

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by thephantom
    actually, the "shell" command works too. Is it better to use the process.start?
    Ofcourse , what better is , it's using managed code and no damn API .

  5. #5
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    299
    That code works fine if you are using an application for the filename. If you want to, say, open an excel file, with only the filename of the excel file, then this would be better

    Code:
            Dim ss As Process
            ss.StartInfo.FileName = theExcelFileName
            ss.StartInfo.UseShellExecute = True
            ss.StartInfo.RedirectStandardOutput = False
            ss.Start()

  6. #6
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Originally posted by But_Why
    That code works fine if you are using an application for the filename. If you want to, say, open an excel file, with only the filename of the excel file, then this would be better

    Code:
            Dim ss As Process
            ss.StartInfo.FileName = theExcelFileName
            ss.StartInfo.UseShellExecute = True
            ss.StartInfo.RedirectStandardOutput = False
            ss.Start()
    How would that work better? I can send "business.xls" (I'm not sure of the excel extension, lets pretend it is .xls if I am wrong) to Process.Start() and it opens the file into excel.

  7. #7
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    I think it's goin to lead to the same
    \m/\m/

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by But_Why
    That code works fine if you are using an application for the filename. If you want to, say, open an excel file, with only the filename of the excel file, then this would be better

    Code:
            Dim ss As Process
            ss.StartInfo.FileName = theExcelFileName
            ss.StartInfo.UseShellExecute = True
            ss.StartInfo.RedirectStandardOutput = False
            ss.Start()
    It's the same but longer , better to use the static Process class with only one line of code .

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    india
    Posts
    273

    thanks

    thank u genious

    regards

    ppcc

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