Brain Teaser... Script Required..
Results 1 to 2 of 2

Thread: Brain Teaser... Script Required..

  1. #1
    Join Date
    Mar 2003
    Posts
    38

    Brain Teaser... Script Required..

    hv a system which have two folders in my c: drive. Now these folders hv some set of files and other folders . Now i want to design s batch file or a windows scripting file which can do the following thing
    Let me explain it again.

    I hv two main folders in myhdd .Those folders contains many othe folders and files. and each folder itself contain many other files and folders. Now what io hv to create a new folder which will contain the these two folders and all the folder and unique files of each folder.


    lets say folder1 has three folders aa bb and cc ,dd

    --->aa has files 11 ,22,33
    ---->bb has files xx,yy,zz
    ---->cc has files xxx,yyy,zzz


    lets say folder 2 has three folders aa bb and cc ,ee

    --->aa has files 11 ,222,333
    ---->bb has files xx,yy,zzz
    ---->cc has files xxx,yyyy,zzzz


    now the final folder

    folder12 should hv folders aa,bb,cc,dd,ee

    aa should hv ---> 11,22,33,333,222
    bb should hv ---> xx,yy,zz,zzz
    cc should hv ---> xxx,yyy,zzz,yyyy,zzzz




    If i m correct we hv to design a recursive script...



    i m very...very... confused ...



    Plz help me

    I appreciate every bit of help..

  2. #2
    Join Date
    Feb 2000
    Location
    26.03°N 80.14°W
    Posts
    9,410
    Four assumptions:
    1. It doesn't matter if files with matching filenames are overwritten.
    2. Folder "folder12" already exists.
    3. You are at the DOS prompt in the parent directory of all threee folders, ("folder1", "folder2" and "folder12").
    4. Windows XP's XCOPY and FOR commands work the same as they did in Windows 9x/Me.
    The DOS command to use then would be:
    • for %%x in (1 2) do xcopy folder%%x\*.* folder12 /s
    Vernon Frazee, Microsoft MVP (Windows - Shell/User)

    Defenses Up!
    Tip: When prompted for a password, give an incorrect one first. A phishing site will accept it; a legitimate one won't.


    Inside Spyware: A Guide to Finding, Removing and Preventing Online Pests


    If you don't keep up with security fixes, your computer|network won't be yours for long.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •