My HTPC was giving more and more problems and so I decided to reinstall the system. I'm running Windows 7 on my laptop and workstation so I wanted to try it on the HTPC as well. I did run into a couple of problems but though, here's what I needed to fix:
The soundcard of my Biostar P4VBM800 motherboard was working. The onboard chip is a C-Media CMI9761, which should be AC97 compatible but Windows did not detect it. after a little trial and error I found these drivers. Audio's working fine now, even the digital output works.
My ATI Radeon X1600 was detected but the standard MS driver does not support OpenGL. After trying a couple of solutions I found that the 7.11 Catalyst Vista Drivers work fine.
My HTPC is quite old (Pentium 4 @2,53 GHz with 1 GB RAM) but Windows 7 was running like a champ, better then XP and of course the biblically terrible Vista. So now I needed to install some media players:
First I installed XBMC as my main media center. This was the main reason I needed to get OpenGL going. XBMC does not do hardware accelerated video playback so I also installed MPC-HC and now my old HTPC is capable of 720p video playback at 25% CPU load.
Last I installed Hulu and used HotSpot Shield to access Hulu outside of the US. Video playback is fairly watchable on low quality, I'm going to check some other VPN solutions to see if I can get this to work better.
Monday, June 22, 2009
Tuesday, June 16, 2009
VBScript: Remove old Windows Updates
My virtual machines regularly fill up their system disks, with old uninstall information. I was getting tired of fixing this manually, so I wanted to create a script to do this automatically. I found a script that removed all updates and modified it to only remove updates older than 90 days:
Save this code as removeOldUpdates.vbs and schedule a task to run weekly.
I'm thinking about expanding this script to clean up all kinds of temporary files.
Option Explicit
Dim o, oShell, nConfirm
Set o = WScript.Application
o.Interactive = True
Set oShell = CreateObject("WScript.Shell")
nConfirm = oShell.Popup("Do you want to remove Windows Update Uninstall Files?", 0, "Remove Windows Update Uninstall Files", 4 + 32)
If nConfirm = 7 Then
o.Quit 0
End If
Dim oFSO, sWinDir, oFolder, oDictionary, oSubFolder, sFolderName, sFolderPath, sUpdateName, sDeleted, sFolderDate
Set oFSO = CreateObject("Scripting.FileSystemObject")
sWinDir = oFSO.GetSpecialFolder(0)
sDeleted = vbNullString
Set oFolder = oFSO.GetFolder(sWinDir)
Set oDictionary = CreateObject("Scripting.Dictionary")
For Each oSubFolder In oFolder.SubFolders
sFolderName = LCase(oSubFolder.Name)
sFolderPath = LCase(oSubFolder.Path)
'Check date of update
sFolderDate = oSubFolder.DateCreated
If Left(sFolderName, 12) = "$ntuninstall" And Mid(sFolderName, 13, 2) = "kb" Or Mid(sFolderName, 13, 2) = "q" Then
sUpdateName = Mid(sFolderName, 13, Len(sFolderName) - 13)
'Remove update if older than x days
If DateDiff("d", sFolderDate, Now) > 90 Then
oDictionary.Add sUpdateName, sFolderPath
End If
End If
Next
For Each sUpdateName in oDictionary.Keys
sDeleted = sDeleted & vbCrLF & sUpdateName
sFolderPath = oDictionary.Item(sUpdateName)
On Error Resume Next
oShell.RegDelete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & sUpdateName & "\"
On Error Goto 0
oShell.Run "%ComSpec% /C RD /S /Q " & Chr(34) & sFolderPath & Chr(34), 0, True
Next
If Len(sDeleted) > 0 Then
WScript.Echo "The uninstall data for the following updates are now removed:" & vbCrLf & UCase(sDeleted), vbOKOnly
sDeleted = vbNullString
Else
WScript.Echo "No Windows Update Folders found for removal", vbOKOnly + vbInformation, "Nothing To Do"
End If
o.Quit 0
Save this code as removeOldUpdates.vbs and schedule a task to run weekly.
I'm thinking about expanding this script to clean up all kinds of temporary files.
Thursday, June 11, 2009
VBScript: Find username by AD fullname
I needed to find the username for a large number of active directory users. Turns out it's actually quite easy to do this with VBScript. Save the following script as a VBScript, for instance username.vbs. Change "domainname" to your own domain name.
Now you can search a username by running: cscript username.vbs "Full Username"
Set oArgs = WScript.Arguments
Set objDomain = GetObject("WinNT://domainname")
objDomain.Filter = Array("User")
str2Find = oArgs(0)
For Each aUser In objDomain
If LCase(str2Find) = LCase(aUser.FullName) Then
Wscript.Echo str2Find & "=" & aUser.Name
strUser = aUser.Name
End If
Next
Set objDomain = Nothing
Now you can search a username by running: cscript username.vbs "Full Username"
Monday, May 18, 2009
Sync Windows Mobile with Google Calendar
In this post I discussed Syncing Windows Mobile with Google Calendar using ActiveGCSync. Now I have found a way to sync your calendar using regular Active Sync.
Google has a new synchronisation service called Google Sync. The service is only available for Google Apps users so you need to set up a new calendar in Google Apps. Google Apps is still free up to a maximum of 50 users, but the registration page is difficult to find. You can find the registration page here.
Here's how I set up my calendar synchronisation:
1. Register a new account for Google Apps
2. Open Domain Settings, set Control Panel to "Next generation (US English only)"
3. Open Service Settings and enable Google Sync
4. Enable Google Calendar for your account
5. Set up ActiveSync using this guide
If your PDA was already in sync, this is all you needed to do. Use the Google Apps calendar from now on. If you need to export the appointments from your old Google calendar use this guide and this guide to import them again.
So far this has been working great, I'm getting less errors than ActiveGCSync used to generate. Now let's see when Google will allow ActiveSync to work with Gmail.
Google has a new synchronisation service called Google Sync. The service is only available for Google Apps users so you need to set up a new calendar in Google Apps. Google Apps is still free up to a maximum of 50 users, but the registration page is difficult to find. You can find the registration page here.
Here's how I set up my calendar synchronisation:
1. Register a new account for Google Apps
2. Open Domain Settings, set Control Panel to "Next generation (US English only)"
3. Open Service Settings and enable Google Sync
4. Enable Google Calendar for your account
5. Set up ActiveSync using this guide
If your PDA was already in sync, this is all you needed to do. Use the Google Apps calendar from now on. If you need to export the appointments from your old Google calendar use this guide and this guide to import them again.
So far this has been working great, I'm getting less errors than ActiveGCSync used to generate. Now let's see when Google will allow ActiveSync to work with Gmail.
Subscribe to:
Posts (Atom)