To run dos commands in C programming

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • allenrotrick
    New Member
    • Apr 2008
    • 2

    #1

    To run dos commands in C programming

    hi all,
    i want to create a folder add1 inside add, add is in current directory.
    [code=c]
    #include<stdio. h>
    #include<stdlib .h>
    void main()
    {
    system("cd add");
    system("md add1");
    }
    [/code]
    pls find me answer for this...
    thanks
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Does that not work? What errors are you getting?

    PS - you may find you are getting compiler errors from a non-standard setup, I'd recommend using int main() to start your program.

    Comment

    • compman9902
      New Member
      • Mar 2007
      • 105

      #3
      Since you have attempted the code, I think that it is okay for me to help you out using code.
      Try this:
      Code:
      system("MKDIR \"C:\\add\\add1\\\"");

      Comment

      Working...