# Using Copy Command with Task Scheduler



## Peter_Makati

Hello everybody,

I am trying to backup several files and folders using Task Scheduler. Among the files that I am trying to backup is the outlook.pst, which contains my outlook data.

From earlier postings, I realize that I in Task Scheduler I cannot specify the jobs to be backed up using the Backup utility.

Instead, I am now trying to simply copy files from one directory to another. How can I tell Task Scheduler to execute a Copy command? For example: I would like to do the following: copy from

c:\My Documents\Private Files\Financial\Bank Records.doc

to

c:\My Backup\All Backup Files\Financial\Bank Backup.doc
Thank you for your help.

Peter


----------



## Max19

You have to write a batch file or other program that actually executes the Copy. Then you use Task Scheduler to schedule a time to run that batch file.

You would create a text file, name it backup.bat. To edit the file, do not double click on it. Right click it and choose Edit. Enter text like:

copy c:\File.txt c:\Backup\File.txt


----------



## Dan O

Peter,

You mentioned the limitations of Windows 98 Backup and Task Scheduler very well. Microsoft as usual purchased the Backup software, they did not write it. To keep their costs down they opted for a less functional version. I am pretty sure it was from Seagate, who is now owned by Veritas. You can get the full functioning version of the product, which is called VERITAS Backup Exec Desktop Edition. But there are many others Backup uilities with a scheduler as well, such as Backup Scheduler 98, see: http://www.cibeo.com/software_store/backup_scheduler_98/default.htm


----------



## Peter_Makati

Thank you for your help.

I tried your suggestion but the batch file does not work: I get error messages saying that I have too many parameters.

I think that there may be two problems: my filenames
a) Have spaces in them (such as "My Files" folder) and possibly
b) Are too long (such as "My backup documents" folder)

Please tell me how to work around this limitation.

Thank you.

Peter


----------



## angel

Try using the dos names. For example, 'my Documents' would be mydocu~1, 'program files' would be progra~1, 'mytestfiles.txt' would be mytest~1.txt
It will be the first 6 letters (without any spaces), a tilde(~), a 1 (in most cases, unless you have similarly named folders/files where it might be a 2 or 3, etc) and then the 3 character extension (if there is one).


----------



## Ratboy

You can also use quotes in the command line and use the complete folder names. For example (I actually used these folder names successfully):

copy c:\"program files"\"this is a test folder"\test.txt c:\"put the file here folder"


----------



## Max19

I would avoid using 8.3 format in the batch file. Put quotes around the paths instead. If you use the shortened file/folder names, then you won't actually be able to restore your system to the way it is now. You'd have to manually rename everything.


----------



## Peter_Makati

Thank you very much for all your help.

The quotes around the folders and filenames work well. 

Now I need to close Outlook before I do my copy operation. What command should I use? (I know that "start" is used to run a program; I am looking for the opposite of "start".)

Thank you again.


----------

