Q:

The batch just close when i want to write into a vbs script

I don't know why this code don't make a vbs file... The batch window just close when i call it.
I searched on google how to make it work, but i didn't found something to help me.
(echo Dim oPlayer
echo Set oPlayer = CreateObject("WMPlayer.OCX")
echo oPlayer.URL = sound.mp3
echo oPlayer.controls.play 
echo While oPlayer.playState <> 1 ' 1 = Stopped 
echo WScript.Sleep 100 
echo oPlayer.close ) > testname.vbs
pause

How to make it work?

A:

I figured it out... I had to add some ^ at comands. I changed this 2 commands:
echo Set oPlayer = CreateObject("WMPlayer.OCX")
echo While oPlayer.playState <> 1

in
echo Set oPlayer = CreateObject("WMPlayer.OCX"^)
echo While oPlayer.playState ^<^> 1

