As the UserAccounts.CommonDialog object can no longer be used in any Windows version newer then XP I'm looking for a replacement.

The code below works fine for folders but I actually need it for files. I found something about BrowseForFile instead of BrowseForFolder but I don't seem to be able to find/get/make some working code.
What I need is something similar like below that returns the filename with the full path or the filename and the path separated.

Maybe I'm just not skilled enough in COM scripting.
Does anyone have a bright idea?


 Code:
Break on

Dim $oApp, $ofolder, $RootPath

$oApp = CreateObject("Shell.Application")
$ofolder = $oApp.BrowseForFolder(0, "Select folder", 16384)
$filename = $ofolder.Title
$RootPath = $ofolder.Self.Path

? @ERROR
? @SERROR

?$filename
? $RootPath

$oApp = ""

Sleep 5
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.