Posted 08 August 2012 - 22:16
I'm not aware of any way you could accomplish upload complete detection in Batch. In my experience, it would probably be fairly difficult in most conventional scripting languages. I'm inclined to say that AutoIt may be more suited to your needs since it is designed for Windows task automation; however, I cannot help you any more without more context.
Some things to think about:
What does your script do? If your Batch script is designed to help you, or others, automate upload to YouTube, you are probably going to need a much more powerful language that can make use of the YouTube API. If, on the other hand, detecting when a video upload is complete is merely a sub-routine or secondary functionality in your script, maybe you could refactor or simply do without it.
How will it be used? Its important to consider how your users will interact with this script. If you prompt your user to begin the video upload and want your script to wait until he is done, that involves minimal interaction with YouTube itself. In fact, you could just ask your user to tell you when the upload is complete in that scenario. However, if you are trying to alert the user when any video upload has completed, you are probably using the wrong language. If this is merely a small part of a larger script, consider coding a tool to check the upload in another language and calling it from your Batch script. Then you can design the interface with your script however you want.
How much control do you have of your environment? If this is a standalone component and you are free to choose and language and environment you want, why not write a Firefox or Chrome plugin that checks YouTube upload status explicitly? This seems like the cleanest and best place for this type of functionality, but it strays further from your original idea of coding it in Batch.