Diagnostics process - dos command

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

    Diagnostics process - dos command

    The following process won't work if I use "move" in the FileName. However, if I replace it with @"c:\winnt\syst em32\xcopy.exe ", then it works fine. Is there anything I missed. It is running on Windows 2000 server (not Advanced Server)

    Process d
    d = new Process()
    d.EnableRaising Events = false
    d.StartInfo.Fil eName = "move"
    d.StartInfo.Arg uments = @"c:\*.jpg c:\image\"
    d.Start()
    d.Close()
    d.Dispose();
  • Michael Giagnocavo [MVP]

    #2
    Re: Diagnostics process - dos command

    Try setting UseShellExecute (?) to true.
    -mike
    MVP

    "RSAGS" <anonymous@disc ussions.microso ft.com> wrote in message
    news:936EAAAB-D85A-4AAA-9A71-E5B52BAD0D3E@mi crosoft.com...[color=blue]
    > The following process won't work if I use "move" in the FileName.[/color]
    However, if I replace it with @"c:\winnt\syst em32\xcopy.exe ", then it works
    fine. Is there anything I missed. It is running on Windows 2000 server
    (not Advanced Server).[color=blue]
    >
    > Process d;
    > d = new Process();
    > d.EnableRaising Events = false;
    > d.StartInfo.Fil eName = "move";
    > d.StartInfo.Arg uments = @"c:\*.jpg c:\image\" ;
    > d.Start();
    > d.Close();
    > d.Dispose();[/color]


    Comment

    • Nicholas Paldino [.NET/C# MVP]

      #3
      Re: Diagnostics process - dos command

      RSAGS,

      I believe that move is something that is interpreted by the command
      line, not an actual process. So, to get it to work, your executable would
      have to be CMD.EXE and then pass "MOVE" as the first parameter.

      Hope this helps.


      --
      - Nicholas Paldino [.NET/C# MVP]
      - mvp@spam.guard. caspershouse.co m

      "RSAGS" <anonymous@disc ussions.microso ft.com> wrote in message
      news:936EAAAB-D85A-4AAA-9A71-E5B52BAD0D3E@mi crosoft.com...[color=blue]
      > The following process won't work if I use "move" in the FileName.[/color]
      However, if I replace it with @"c:\winnt\syst em32\xcopy.exe ", then it works
      fine. Is there anything I missed. It is running on Windows 2000 server
      (not Advanced Server).[color=blue]
      >
      > Process d;
      > d = new Process();
      > d.EnableRaising Events = false;
      > d.StartInfo.Fil eName = "move";
      > d.StartInfo.Arg uments = @"c:\*.jpg c:\image\" ;
      > d.Start();
      > d.Close();
      > d.Dispose();[/color]


      Comment

      • RSAGS

        #4
        Re: Diagnostics process - dos command

        Nicholas it works great. Thank
        Michael thanks.

        Comment

        Working...