Results 1 to 9 of 9

Thread: Just how to execute a file?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    8

    Just how to execute a file?

    Someone, please post some vb.net code, on how to execute a file, without the full path. Like if my program is at D:\Program\program.exe, and it has to execute the file that's in D:\Program\data\file.exe , just with a click of a button.
    Normally that would just be data/file.exe....

    Many thanks in advance.
    "Tickets? Since when did they start charging for the bus? Didn't we used to ride that **** to school every morning for free?" - Jay

  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    VB Code:
    1. process.start("hello.exe")

    If it doesn't work, you may need to reference another object or use the full class path... or whatever it's called.. it's like

    system.diagnostics.process.start()

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    8

    Re: Just how to execute a file?

    Originally posted by fwm
    Someone, please post some vb.net code, on how to execute a file, without the full path. Like if my program is at D:\Program\program.exe, and it has to execute the file that's in D:\Program\data\file.exe , just with a click of a button.
    Normally that would just be data/file.exe....

    Many thanks in advance.
    Yeah, that worked. Thank you much
    "Tickets? Since when did they start charging for the bus? Didn't we used to ride that **** to school every morning for free?" - Jay

  4. #4
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: Re: Just how to execute a file?

    Originally posted by fwm
    Yeah, that worked. Thank you much


    np but you kind of thanked yourself.... lol

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    8

    Re: Re: Re: Just how to execute a file?

    Originally posted by kasracer


    np but you kind of thanked yourself.... lol
    haha, yeah, kinda quoted the wrong post. But thank you very very much kasracer
    So... now that has been cleared up
    "Tickets? Since when did they start charging for the bus? Didn't we used to ride that **** to school every morning for free?" - Jay

  6. #6

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    8

    Dammit

    Ok, I tested this on a clean form, with only one button and that command.

    But then when I added groupboxes, labels, pictureboxes, it's now giving my this error:

    Process.start("hello.exe")

    'start' is not a member of 'System.Windows.Forms.GroupBox'.

    I think that's wierd. It worked perfect before I started adding controls to the form!
    "Tickets? Since when did they start charging for the bus? Didn't we used to ride that **** to school every morning for free?" - Jay

  7. #7
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Sounds like you put the code on the wrong object (a groupbox)

  8. #8

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    8
    Originally posted by kasracer
    Sounds like you put the code on the wrong object (a groupbox)
    Negative, I have the code like this:
    Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Process.Start("hello")
        End Sub
    "Tickets? Since when did they start charging for the bus? Didn't we used to ride that **** to school every morning for free?" - Jay

  9. #9

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    8
    Hey, I figured it out. I'm just using this, and then it works:


    Dim Alarm As Process = New Process
    Alarm.Start("hello.exe")
    "Tickets? Since when did they start charging for the bus? Didn't we used to ride that **** to school every morning for free?" - Jay

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