I’m trying to make a batch file through Notepad to essentially automate a process of moving files from drive to drive.
My aim is to move files from my H drive to my A drive, H:\Arco\examplefile.csv to \A:\DSE\Open_Access_Data\ARCo.
I also want to automate this job to run every 30 minutes if possible. But if I need to do it by clicking it then so be it. So far, all I’ve managed to do is copy files over to my desktop. I can’t seem to get it to go between my directories.
COPY H:\dehpc14_Disk_Quota_Report.csv %userprofile%\Desktop
This should work:
That will copy your files every 30 seconds and overwrite any existing files.
Note: The
timeoutcommand is only availble in Vista and above, if you need to use this on XP let me know.To launch the batch file on system startup you can either put it in the startup folder of the user or use the registry.
The startup folder for the current user is
For all users
Or you can use the registry which I personally prefer. Create a string value with the path to your batch file in
Current user
Computer users
Both registry options will require admin rights though.
To do either startup or registry in batch respectively
Which will either copy itself to startup or add itself to the registry each time it runs. So you can either do it manually or have it do this itself (above commands) from the first time you run it.
The
%0is the batch files own path, if you want to use the commands from somewhere else, or just from cmd then type in the full path of the batch file instead.