Thread: system() question

  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    8

    system() question

    Here's what I'm doing. I am copying a folder from a cd to a hard drive. Basically, I won't be able to know what the label of the CD-ROM drive will be so this code is used:

    system ( "..\\..\\xcopy ..\\..\\* c:\\INSTALLER_4_0_CD\\* /E /Y" ) ;

    I understand the basic concept of xcopy, I've wrote a test program to test just that, but I am trying to understand, with the above code, why and how the above code is written with the [ ..\\..\\] and so on.

    The way I see it, xcopy should be used this way: XCOPY source [destination] [options]

    I guess what's really throwing me off is the ..\\..\\

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    I don't know why you have the first ..\\..\\ because xcopy should always be in your path, given that it's a command and all. The others are just to get the paths right.

  3. #3
    Registered User
    Join Date
    Apr 2007
    Posts
    137
    Never use system() on Windows
    (Use Win32 shell apis to copy folders)

  4. #4
    Registered User
    Join Date
    Oct 2009
    Location
    While(1)
    Posts
    377
    U shuld use the path like Linux (Very Cool OS the Best ) style
    ../../xcopy ../../*.c etc

  5. #5
    Registered User
    Join Date
    Sep 2009
    Posts
    8
    Quote Originally Posted by RockyMarrone View Post
    U shuld use the path like Linux (Very Cool OS the Best ) style
    ../../xcopy ../../*.c etc
    yeah it was late last night where I realized the ..\\..\\ were like a command in Terminal. I can't choose the OS here unfortunately. This is my first time having to dive into DOS.

  6. #6
    Registered User
    Join Date
    Oct 2009
    Location
    While(1)
    Posts
    377
    hey buddy Microsoft also accept ../../ kind of relative path

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Obama on health care
    By MK27 in forum General Discussions
    Replies: 35
    Last Post: 09-11-2009, 07:05 PM
  2. another exercise question
    By luigi40 in forum C# Programming
    Replies: 3
    Last Post: 11-28-2005, 03:52 PM
  3. Question about the System() function...
    By YankeePride13 in forum Linux Programming
    Replies: 4
    Last Post: 11-18-2005, 02:45 PM
  4. System programming question.
    By kiss_psycho in forum C++ Programming
    Replies: 9
    Last Post: 02-21-2003, 04:56 PM
  5. Very simple question, problem in my Code.
    By Vber in forum C Programming
    Replies: 7
    Last Post: 11-16-2002, 03:57 PM