Sure. You can execute the command 'ipconfig' and parse the output with the script. Another more kludgy way is if you do NOT have dial-on-demand set, you can ping a known address periodically and check the result.
But allow me to ask an exploratory question: Are you trying to determine if the link is down before you go off to a site, or are you attempting something else? Because it's Windows, there might be a better way to do it. If you can clarify what you're trying to do, we might be able to come with a more 'creative' solution.