mcse2007
asked on
Copying specific folder via batch file
Hi,
I'm new to scripting and I'm hoping someone can assist with the below required tasks:
I need to copy the below folder from C drive into F drive partition and if possible automate the copying using the Windows Task Scheduler
\Genie
I just need a batch file that I can use to fullfil the above required task.
Appreciate your generous help.
I'm new to scripting and I'm hoping someone can assist with the below required tasks:
I need to copy the below folder from C drive into F drive partition and if possible automate the copying using the Windows Task Scheduler
\Genie
I just need a batch file that I can use to fullfil the above required task.
Appreciate your generous help.
ASKER
For backup purpose then automate it through Windows Task Scheduler.
Hello mcse2007,
I can show you a BATCH DOS script to do that. So this is an example.
This code put in a file with extension .BAT. This is an example and click on .BAT file.
@echo off
echo.
echo.
F:
cd \
md "F:\My Computer\Favorites"
xcopy "C:\Documents and Settings\KORISNIK\Favorites\*.*" "F:\My Computer\Favorites" /S/E/Y
echo. All IE Favorites are copied to F: disk !!!
echo.
echo. The end of the job!!!
echo. Please press the any key on the keyboard to close this window !
echo.
pause
For eventually explanation ask me free.
Nrisimha
So for your folder C:\Genie you have this code for BAT script:
@echo off
echo.
echo.
F:
cd \
md "F:\Genie"
xcopy "C:\Genie\*.*" "F:\Genie" /S/E/Y
echo. All files from C:\Genie are copied to F:\Genie disk !!!
echo.
echo. The end of the job!!!
echo. Please press the any key on the keyboard to close this window !
echo.
pause
Nrisimha
ASKER
Hi Nrisimha,
The /S copy, the /E copy empty folder, what's the /Y ?
Cheers
The /S copy, the /E copy empty folder, what's the /Y ?
Cheers
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@mcse2007
If this is a backup need, what will happen the 2nd time this runs? Will the destination folder exist from last backup, and do you want to overwrite? If that is the case and you want a mirror of the live source folder, then robocopy with the /MIR option is probably the most appropriate.
As far as how to set up a job to run in the task scheduler just google for that and there are many good descriptions of that process available.
~bp
If this is a backup need, what will happen the 2nd time this runs? Will the destination folder exist from last backup, and do you want to overwrite? If that is the case and you want a mirror of the live source folder, then robocopy with the /MIR option is probably the most appropriate.
As far as how to set up a job to run in the task scheduler just google for that and there are many good descriptions of that process available.
~bp
Well, if anybody need Windows Command Reference - Windows 7/2008 then you can download a CHM file from:
http://www.microsoft.com/d
Nrisimha
ASKER
Thanks for your help Nrisimha.
With your approach and attitude in solving problem, in no time, you will gain prominence here in EE. Well done mate and thanks for your help.
With your approach and attitude in solving problem, in no time, you will gain prominence here in EE. Well done mate and thanks for your help.
Thank you mcse2007,
But I have to write something. If you want to enable Backup with an Genie folder that already exists on F: drive then use the next code:
@echo off
move "F:\Genie" "F:\Genie1"
md "F:\Genie"
xcopy "C:\Genie\*.*" "F:\Genie" /S/E/Y
rd "F:\Genie1" /S/Q
Nrisimha
Or if you want to move it without keeping a copy in the current location just drag and drop the folder on the f: drive
Cd&