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. Dos Command

Dos Command

Scheduled Pinned Locked Moved C#
csharpquestion
5 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.
  • M Offline
    M Offline
    M Riaz Bashir
    wrote on last edited by
    #1

    Hi Experts, Kindly let me know that, How may I use following command using C#? MD C:\ABC123 Regards (Riaz)

    realJSOPR P M 3 Replies Last reply
    0
    • M M Riaz Bashir

      Hi Experts, Kindly let me know that, How may I use following command using C#? MD C:\ABC123 Regards (Riaz)

      realJSOPR Offline
      realJSOPR Offline
      realJSOP
      wrote on last edited by
      #2

      Google is your friend: http://msdn.microsoft.com/en-us/library/as2f1fez.aspx[^]

      .45 ACP - because shooting twice is just silly
      -----
      "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
      -----
      "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

      M 1 Reply Last reply
      0
      • M M Riaz Bashir

        Hi Experts, Kindly let me know that, How may I use following command using C#? MD C:\ABC123 Regards (Riaz)

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #3

        Well, MD means Make Directory, so you could always use the equivalent .NET Framework commands:

        if (!Directory.Exists(myDirectory))
        {
        Directory.CreateDirectory(myDirectory);
        }

        I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

        Forgive your enemies - it messes with their heads

        My blog | My articles | MoXAML PowerToys | Onyx

        1 Reply Last reply
        0
        • realJSOPR realJSOP

          Google is your friend: http://msdn.microsoft.com/en-us/library/as2f1fez.aspx[^]

          .45 ACP - because shooting twice is just silly
          -----
          "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
          -----
          "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

          M Offline
          M Offline
          M Riaz Bashir
          wrote on last edited by
          #4

          Thank you

          1 Reply Last reply
          0
          • M M Riaz Bashir

            Hi Experts, Kindly let me know that, How may I use following command using C#? MD C:\ABC123 Regards (Riaz)

            M Offline
            M Offline
            MasttsaM
            wrote on last edited by
            #5

            Process p = new Process(); p.StartInfo.FileName = "cmd.exe"; p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardInput = true; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.RedirectStandardError = true; p.StartInfo.CreateNoWindow = true; if (p.Start()) { p.StandardInput.WriteLine("net use " + strFileName + " " + strPwd + " /user:" + strDomain + "\\" + strId); p.StandardInput.WriteLine("exit"); p.WaitForExit(); string ReturnText = p.StandardOutput.ReadToEnd(); if (ReturnText.IndexOf("成功") >= 0) Dts.TaskResult = (int)ScriptResults.Success; else throw new Exception("fail"); } else throw new Exception("fail"); Refrence: http://www.programlive.tk

            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