Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Diagnostics.process

Diagnostics.process

Scheduled Pinned Locked Moved C#
help
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shaahinm
    wrote on last edited by
    #1

    Hi I want to open other file types using my form I used (Process.start("sth.exe","sth.sth");) it works some times but some times when(I think) the path name have space within it ,it causes error like this (Process.start("wmplayer.exe","track 01.mp3");) if I write this one (Process.start("wmplayer.exe","track01.mp3");) instead of the above one it works can any one explain it to me and a solution please.

    G S K 3 Replies Last reply
    0
    • S Shaahinm

      Hi I want to open other file types using my form I used (Process.start("sth.exe","sth.sth");) it works some times but some times when(I think) the path name have space within it ,it causes error like this (Process.start("wmplayer.exe","track 01.mp3");) if I write this one (Process.start("wmplayer.exe","track01.mp3");) instead of the above one it works can any one explain it to me and a solution please.

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      The second parameter is interpreted as argument to the process you are starting. If it includes spaces, then the string will be split by spaces and resulted strings will be passed as multiple arguments.

      #region signature my articles #endregion

      1 Reply Last reply
      0
      • S Shaahinm

        Hi I want to open other file types using my form I used (Process.start("sth.exe","sth.sth");) it works some times but some times when(I think) the path name have space within it ,it causes error like this (Process.start("wmplayer.exe","track 01.mp3");) if I write this one (Process.start("wmplayer.exe","track01.mp3");) instead of the above one it works can any one explain it to me and a solution please.

        S Offline
        S Offline
        Shaahinm
        wrote on last edited by
        #3

        Ok thanks Is there a way to solve it?

        G 1 Reply Last reply
        0
        • S Shaahinm

          Ok thanks Is there a way to solve it?

          G Offline
          G Offline
          Giorgi Dalakishvili
          wrote on last edited by
          #4

          As far as I remember you will need to enclose the parameter itself with quotes but I'm not sure if that will help. Give it a try.

          #region signature my articles #endregion

          1 Reply Last reply
          0
          • S Shaahinm

            Hi I want to open other file types using my form I used (Process.start("sth.exe","sth.sth");) it works some times but some times when(I think) the path name have space within it ,it causes error like this (Process.start("wmplayer.exe","track 01.mp3");) if I write this one (Process.start("wmplayer.exe","track01.mp3");) instead of the above one it works can any one explain it to me and a solution please.

            K Offline
            K Offline
            Kristian Sixhoj
            wrote on last edited by
            #5

            I had a problem like this once. Putting the file name in quotes helped:

            Process.Start("wmplayer.exe","\"track 01.mp3\"");

            Kristian Sixhoej


            "Failure is not an option" - Gene Kranz

            E 1 Reply Last reply
            0
            • K Kristian Sixhoj

              I had a problem like this once. Putting the file name in quotes helped:

              Process.Start("wmplayer.exe","\"track 01.mp3\"");

              Kristian Sixhoej


              "Failure is not an option" - Gene Kranz

              E Offline
              E Offline
              electriac
              wrote on last edited by
              #6

              I also had this problem several years ago and since finding that this works I have used it this way but I am not sure if it is the best solution. Process.Start("wmplayer.exe","\x22track 01.mp3\x22"); This does work however.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups