You can use the below to detect Vista (and I'm sure Google will confirm the XP version), and then can you not go to the location directly? i.e. c:\users\public.
Code: vbscript
- strComputer = "."
- Set WshShell = CreateObject("WScript.Shell")
- Dim WshShell
- Set objWMIService = GetObject("winmgmts:" & _
- "{impersonationLevel=impersonate}!\\" & strComputer & _
- "\root\cimv2")
- Set colOperatingSystems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
- For Each objOperatingSystem In colOperatingSystems
- If Instr(objOperatingSystem.Caption, "Vista") > 0 Then
- IsVista = True
- End If
- Next
Not many people change this location, and if you find (via vbscript) that the directory does not exist, you could prompt the user to locate it.