This script (a modification of one of Rob van der Woude's) works fine on XP 32-bit, but fails on 7 64-bit at Set objDialog = CreateObject( "UserAccounts.CommonDialog" ), with something similar to the error (translated from Dutch) ActiveX cannot create the object "UserAccounts.CommonDialog". Is there some different way that I have to do this for it to be compatible with Windows 7?
MsgBox("Your input avi MUST be exported at 60fps, or this script will not work."),0,"IMPORTANT!"
MsgBox("Please select the location of your AVI."),0,"AVI location"
WScript.Echo GetFileName( "", "AVI files (*.avi)|*.avi" )
Function GetFileName( myDir, myFilter )
Dim objDialog
Set objDialog = CreateObject( "UserAccounts.CommonDialog" )
If myDir = "" Then
objDialog.InitialDir = CreateObject( "WScript.Shell" ).SpecialFolders( "MyDocuments" )
Else
objDialog.InitialDir = myDir
End If
If myFilter = "" Then
objDialog.Filter = "All files|*.*"
Else
objDialog.Filter = myFilter
End If
If objDialog.ShowOpen Then
GetFileName = objDialog.FileName
Else
GetFileName = ""
End If
End Function