Windows Media Encoder 9 : Batch file encoding videos from mpg, avi, asf to wmv

This recipe will explain how to use a batch file i’ve written and windows media encoder 9 to convert mpg / avi / asf video files to wmv. The batch file will allow you to convert a folder full of videos one at a time w/a specific profile. The best part about this recipe is that all the ingredients are free. 🙂

Microsoft has made the Windows Media Encoder 9 application available since Media Player 9, however most are not aware of its power and utility. This recipe will explain one way to use it to batch convert a folder of video files to wmv (will work with mpg (divx too), avi, asf).


Windows Media Encoder 9

My batch files and prx profiles


1. Install Windows Media Encoder 9.
2. Save my zip file to your c: and extract the zip file of my batch and prx files to your c:

so you should have a C:\WME folder

3. You can use the batch files as is if you want, just put your mpg, avi, and/or asf files in the RAW folder (default c:\wme\raw).

Then go to the App folder and run the Convert to Zune Display.bat to convert the videos to my zune profile
run the High_quality Convert.bat for a higher quality conversion.

Let it process, it takes about 150 secs per 4 min video file. Once its done, you should have a Converted folder in C:\WME\ with your converted videos!

You can create your own profile using the Windows Media Profile Editor in the start menu folder.


-The zune profile settings are as follows:
320×240 resolution, 256kbps video, 30fps, 192kbs/44khz stereo sound

-The high_quality profile settings are as follows:
Same as input size, 768kbps video, 30fps, 192kbs/44khz stereo sound

-To change the folder settings, you will just need to edit the batch file and the idir and odir folder settings (see below)


About Jimmy Selix

Jimmy Selix is an early adopter that loves to be one of the first on the block to have the latest and greatest in technology and gadgets. Another love of his is being able to share his knowledge to others seeking it. Feel free to drop any comments or questions that you may have.
View more articles by Jimmy Selix

The Conversation

Follow the reactions below and share your own thoughts.

  • Is there away to use xvid codecs for the encdoing?

    • Robert

      I have been using the High Quality script for videos on my xbox 360.
      Can this script be used with mkv files if I modify the code to include them?

  • Dennis

    At first I noticed wm9 stream superior to every other stream. Especially vbr. I tested the vbr against divx 7, and there is no comparison. The wmv vbr files are far superior. At least in my interest of 600 by 480

    However I hate the wm9 encoder gui. Few things I ever touched are less responsive.

    I am wondering if your script will do the wm9 vbr?

    Ps. I did try xvid but no luck yet getting anything small and of good quality. Maybe the divx pro can compete with wmv vbr, but not the free. Except MS must make the interface work, while it barely does now.

  • Dennis

    I saved the 1 mb 640×480 session, then edited to the prx format, then made a corresponding bat file. But when I clicked it, I created a huge file with only %50 compression from raw video – not the expected 15 x compression. Need help.

  • Dennis

    Ah, ha. Editing the prx is no good for a lay person. I found if I double clicked the prx, I could change the settings.

    The settings there are plainer, more straight forward than the confusing wizzard. Plus, no unresponsiveness. And video quality beats divx and xvid for size. By a long shot. THis is the perfect solution for me. For others, I think they need a more unified one step application for wm9 encoding. I think especially easy batch vbr encoding built in to the OS could make this the divx killer. And deservedly so, since the quality is so good. I think the next advance will be when the codec does facial recognition to encode faces at high quality. Then we will see bit rates half again. Imagine a watchable stream at 151 kps video which would rival ntsc.

  • almny

    i want to ask also about
    Is there away to use xvid codecs for the encdoing?

  • Visitor

    Excellent script thanks for sharing!

    Just one thing, is it possible for the script to process videos in subfolders of Raw?

    If i could do that it would be perfect for me!

    Many Thanks

  • Anonymous

    when attempting to use your profile – I get an error (codec not found).
    without having to regedit and find these codecs – do you have a certain codec pack that utilizes something I don’t have? (I have a feeling that since I don’t have WMV 9.1 and only have 9.2 is my problem

  • Anonymous

    Thanks for this man, it helps a ton.

  • MJ

    It didn’t work for me. Never converted anything.

  • gswallow

    WME9 Converts file for individual files. Needed a way to batch multiple files and found your script(s). Installed as you have above. Had to files converted so credited the C:WMEConverted folder and dropped them in. Dropped source MSS2/.WMV files into the Raw folder and edited the batch to have wmv instead of avi. I get and error: “Input error: There is no script engine for file extension .vbs” Any ideas how I might remedy this error?

  • Sebastian

    I try to use your script to convert WMV (with G2M3 Codec) into a WMV (WITHOUT G2M3 Codec). So I changes “asf” to “wmv” in your script.
    If I run now the script I get.

    “0xc00d1b5f: The media content defined in the profile does not match the media content defined in the source group.”

    Any ideos what to do?