Home / Microsoft / Microsoft DOS / How to check for files and folders in a directory
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] - (Bottom) Print
Author Topic: How to check for files and folders in a directory  (Read 567 times)
sri53
Topic Starter
Rookie



Posts: 12


« on: November 11, 2009, 04:04:12 AM »

Hi All,

I have some folder 'X'.
Each time new files/folders will be created in 'X'
I have a batch file which copies the newly created files/folders to another folder 'Y'.
we will not delete any files from 'Y' folder.
While copying from 'X' to 'Y' it should copy with the same folder structure as in 'X'.
And also if some file is already there in 'Y', It should move the file to 'YBKUP' folder (with same folder structure as in 'Y') before overwriting.





IP logged
sri53
Topic Starter
Rookie



Posts: 12


« Reply #1 on: November 11, 2009, 04:58:18 AM »

Please help me
IP logged
gpl
Apprentice



Thanked: 25
Posts: 546




« Reply #2 on: November 11, 2009, 05:44:03 AM »

What do you have so far ?
IP logged
sri53
Topic Starter
Rookie



Posts: 12


« Reply #3 on: November 11, 2009, 05:56:04 AM »

Hi gpl,

Thanks for your reply.

I have simple copy command in it which copies only files in 'X' folder.
I am unable to do it with similar folder structure(including subfolders).
It should copy the files with similar structure as in 'X'.


IP logged
sri53
Topic Starter
Rookie



Posts: 12


« Reply #4 on: November 11, 2009, 06:19:31 AM »

can you please help me...
IP logged
sri53
Topic Starter
Rookie



Posts: 12


« Reply #5 on: November 11, 2009, 08:15:13 AM »

please reply me...
IP logged
gpl
Apprentice



Thanked: 25
Posts: 546




« Reply #6 on: November 11, 2009, 10:10:34 AM »

Check the xcopy command (xcopy /? at the command prompt) - this will enable your to copy a directory structure
IP logged
sri53
Topic Starter
Rookie



Posts: 12


« Reply #7 on: November 12, 2009, 02:36:01 AM »

Thanks gpl...

Thing is, before copying it should take up backup of the files which are there in 'X' with same folder structure and then it should copy accordingly, it should not take all the files backup each time.

And moreover xcopy is not working in my system.
I am using MS windows XP professional 2002 version.

Please guide me...
IP logged
sri53
Topic Starter
Rookie



Posts: 12


« Reply #8 on: November 12, 2009, 03:39:10 AM »

Please help me...
IP logged
Oleb
Newbie



Posts: 1


« Reply #9 on: November 12, 2009, 04:07:47 PM »

If You type help xcopy at the dospromp you will get help. ypu might be told to use the command robocopy instead
IP logged
Pages: [1] - (Top) Print 
Home / Microsoft / Microsoft DOS / How to check for files and folders in a directory « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.067 seconds with 20 queries.