Results 1 to 5 of 5

Thread: [RESOLVED] VB 2005 - Get process name programmatically

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2007
    Location
    Howell, MI
    Posts
    134

    Resolved [RESOLVED] VB 2005 - Get process name programmatically

    If I start a program via "Process.Start(c:\...)", is there a way of obtaining the "process name" of said program for use in "Process.GetProcessesByName(...).Length" or any other way?

    Thanks!

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: VB 2005 - Get process name programmatically

    This is why you should read the documentation for the types and methods you use. Doing that would have told you that Process.Start is a function, not a procedure. That means that it returns a value, which in this case is a Process object representing the process you just started. The Process class has a ProcessName property.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 2007
    Location
    Howell, MI
    Posts
    134

    Re: VB 2005 - Get process name programmatically

    It says there is a Process.ProcessName property, I see that, but when I type it in, intellisense doesn't give me anything. Why would that be?

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: VB 2005 - Get process name programmatically

    Attached Images Attached Images  
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Feb 2007
    Location
    Howell, MI
    Posts
    134

    Re: VB 2005 - Get process name programmatically

    Thanks. Remember, I am relatively new to VB. I am trying to do this myself as best I can. But really, thanks.

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