Start In & Processes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Miro

    #1

    Start In & Processes

    In VB-2003,

    I was wondering if someone can point me in the right direction:

    Lets say the user has a shortcut on his desktop to your app.

    1. Is there any way to capture what the "Start In" parameter is when the
    app loads?
    1.1 Is there any way to be able to see this in the Process when you
    grab it?

    I have ran debugger on the variable 'myProcesses' to see what is all stored
    in there,
    myProcesses = Process.GetProc essesByName(Tri m("SomeApp"))

    and I cannot find anywhere where ( and if ) this is stored.

    2. Also, I have read in a previous newsgroup posting I can grab extra
    Arguments passed into "my application"
    using My.Application. CommandLineArgs but is there a way to see
    what arguements were used to run
    the app through the process ? ( even if it is not an application designed
    in VB.net ? )
    I cannot find an "Arg" setting in the myProcesses settings it grabs.


    The reasoning for all of this:
    The user has an app that uses the "Start In" parameter in the shortcut to
    point to the data directory. The actual shortcut
    points to the exe which is in a different directory.

    At certain times of the day my app runs and I want to only kill certain
    processes that are running. - This would depend
    on the Args passed in, and the data directory they are running off of.

    Thanks,

    Miro



  • Miro

    #2
    Re: Start In & Processes - some more info

    For Question # 2 I am using
    txtArgs.Text = System.Environm ent.CommandLine ()
    txtPath.Text = System.Environm ent.CurrentDire ctory()
    the My.Application. CommandLineArgs will not work as I think I have just
    understood it as ( "My" ) is a 2005 vb and im
    using 2003.

    I use the top txt Example get the start Path and Data directory. But I
    still cant figure out a way to get that Information by just the Processes
    from a different application.

    Miro




    "Miro" <mironagy@golde n.netwrote in message
    news:ef$jlsKtGH A.1304@TK2MSFTN GP06.phx.gbl...
    In VB-2003,
    >
    I was wondering if someone can point me in the right direction:
    >
    Lets say the user has a shortcut on his desktop to your app.
    >
    1. Is there any way to capture what the "Start In" parameter is when the
    app loads?
    1.1 Is there any way to be able to see this in the Process when you
    grab it?
    >
    I have ran debugger on the variable 'myProcesses' to see what is all
    stored in there,
    myProcesses = Process.GetProc essesByName(Tri m("SomeApp"))
    >
    and I cannot find anywhere where ( and if ) this is stored.
    >
    2. Also, I have read in a previous newsgroup posting I can grab extra
    Arguments passed into "my application"
    using My.Application. CommandLineArgs but is there a way to see
    what arguements were used to run
    the app through the process ? ( even if it is not an application designed
    in VB.net ? )
    I cannot find an "Arg" setting in the myProcesses settings it grabs.
    >
    >
    The reasoning for all of this:
    The user has an app that uses the "Start In" parameter in the shortcut to
    point to the data directory. The actual shortcut
    points to the exe which is in a different directory.
    >
    At certain times of the day my app runs and I want to only kill certain
    processes that are running. - This would depend
    on the Args passed in, and the data directory they are running off of.
    >
    Thanks,
    >
    Miro
    >
    >
    >

    Comment

    • Miro

      #3
      Re: Start In &amp; Processes - some more info - Closer ?

      Someone has posted this as an answer in another forum

      Process.StartIn fo.WorkingDirec tory

      so i tested it with this ( below ) and it didnt work:
      I let vb compile it, and then made a shortcut to the exe with a
      "Start In" of C:\Temp and the txtOther is empty.
      Is my code correct ? I did this in the Form.Load

      myProcesses = Process.GetProc essesByName(Pro cess.GetCurrent Proce
      ss.ProcessName)
      txtOther.Text = myProcesses(0). StartInfo.Worki ngDirectory()


      Miro

      "Miro" <mironagy@golde n.netwrote in message
      news:%238YZbKMt GHA.4372@TK2MSF TNGP02.phx.gbl. ..
      For Question # 2 I am using
      txtArgs.Text = System.Environm ent.CommandLine ()
      txtPath.Text = System.Environm ent.CurrentDire ctory()
      the My.Application. CommandLineArgs will not work as I think I have just
      understood it as ( "My" ) is a 2005 vb and im
      using 2003.
      >
      I use the top txt Example get the start Path and Data directory. But I
      still cant figure out a way to get that Information by just the Processes
      from a different application.
      >
      Miro
      >
      >
      >
      >
      "Miro" <mironagy@golde n.netwrote in message
      news:ef$jlsKtGH A.1304@TK2MSFTN GP06.phx.gbl...
      >In VB-2003,
      >>
      >I was wondering if someone can point me in the right direction:
      >>
      >Lets say the user has a shortcut on his desktop to your app.
      >>
      >1. Is there any way to capture what the "Start In" parameter is when the
      >app loads?
      > 1.1 Is there any way to be able to see this in the Process when you
      >grab it?
      >>
      >I have ran debugger on the variable 'myProcesses' to see what is all
      >stored in there,
      >myProcesses = Process.GetProc essesByName(Tri m("SomeApp"))
      >>
      >and I cannot find anywhere where ( and if ) this is stored.
      >>
      >2. Also, I have read in a previous newsgroup posting I can grab extra
      >Arguments passed into "my application"
      >using My.Application. CommandLineArgs but is there a way to see
      >what arguements were used to run
      >the app through the process ? ( even if it is not an application
      >designed in VB.net ? )
      >I cannot find an "Arg" setting in the myProcesses settings it grabs.
      >>
      >>
      >The reasoning for all of this:
      >The user has an app that uses the "Start In" parameter in the shortcut to
      >point to the data directory. The actual shortcut
      >points to the exe which is in a different directory.
      >>
      >At certain times of the day my app runs and I want to only kill certain
      >processes that are running. - This would depend
      >on the Args passed in, and the data directory they are running off of.
      >>
      >Thanks,
      >>
      >Miro
      >>
      >>
      >>
      >
      >

      Comment

      Working...