What is the reason of (brutally) terminating Ditto in the first place?
Software like 'Process Governor' or 'Process Tamer' would help closing any application gently, before its memory consumption or CPU consumption becomes too much for your liking.
Best practices regarding RAM consumption by an application is a whole different
Debugging batch scripts involves a lot of handwork, especially when such scripts get a bit more complicated.
Fodder's suggestion is very helpful, it is best to type 'cmd' in the search box of your start menu. Perhaps it would even be better to run the 'cmd.exe' application in administration mode. Navigate to the batch script inside this CMD shell and run the script:
taskkill.exe /im ditto.exe /f
When the PAUSE command is executed in the script you will see the result of the taskkill command you have executed. It the result shows one or more error messages, you can use the key combination CTRL + C to terminate the execution of this batch script (this won't close the CMS shell). Starting the Ditto application before fixing the error message is of no use and can even damage the data that is stored in that application. But you already managed to find that out the hard way.
It is very important to give an application time to close itself properly, so it can save files and data it was working with to allow it to function correctly the next time the application is started. The '/f' parameter of the taskkill command doesn't give any time at all to the application to terminate itself. Therefore it is only to be used as last resort.
For example, if Ditto consumes too much RAM for your liking, proper use of the taskkill
command would be:
taskkill.exe /fi "Memusage gt 500000" /im ditto.exe (this kills Ditto if it uses more than 500MByte of RAM)
Replace the taskkill line in your own script with the line above and use the built-in scheduler of Windows to execute the adjusted batch script on an interval (once per hour, once per day etc.) and Ditto will be properly terminated and restarted automatically, only when it is running out of your optimal settings.
Managing multiple applications in this way is a very time consuming task and there are specific tools here already available on the DC forum that make this a lot easier.
[joke (or not?)]
You are always allowed to use the '/f' parameter like this: taskkill.exe /im excel.exe /f
Follow the link above for more explanation about this command (including some simple examples).
It also looks like you use a non-standard drive and folder setup in this particular Windows setup.
The reported error mentions that it cannot find a file, so that leads to to the following questions:
Y:\ - this is a network drive? And even if it isn't, are you sure you have enough user rights to access this drive and its contents?
Dittoprg64\ - Are you sure you have enough user rights to access this folder and its contents?