Wednesday, October 12, 2011

Force Windows Media Player to remain maximized after closing in Windows 7 (Work around)

If you were used to WMP retaining your preference to stay maximized in Windows XP, and were disappointed when WMP in Windows 7 did not keep this setting, but rather auto adjusted the window size to the resolution of the video, here is something that may help.

The only reason I prefer WMP over VLC or any other player is because of the way it displays/docks the playlist.  I like the playlist to be part of the video window, so it cannot block any of the video or disappear behind windows.  Additionally I liked that WMP would always remain maximized even after I had closed it.  To get around this stupid change that Microsoft has made, I found some VBS code that can assist.

Simply save this code in a file with the extension "vbs" (ie. wmpmax.vbs) and place it in your startup folder.  This will launch every time you log into Windows and will set the appropriate registry key to the value to have WMP maximized.  This will run every 2 seconds (2000 milliseconds).  You can change that value to whatever you want.  Just remember, it's in milliseconds so however long you want it to wait in seconds, times that by 1000.

 Set WshShell = WScript.CreateObject("WScript.Shell")  
 Do Until x = 1  
 WshShell.RegWrite "HKCU\Software\Microsoft\MediaPlayer\Preferences\Maximized", 1 ,"REG_SZ"  
 Wscript.Sleep 2000