Set objDialog = CreateObject("SAFRCFileDlg.FileSave") Set fso = CreateObject("Scripting.FileSystemObject") objDialog.FileName = "test" objDialog.FileType = ".txt" intReturn = objDialog.OpenFileSaveDlg If intReturn Then fso.CreateTextFile(objDialog.FileName & objdialog.filetype) Else Wscript.Quit End if
set objFile = CreateObject("SAFRCFileDlg.FileOpen") bRet = objFile.OpenFileOpenDlg if bRet then Wscript.Echo "文件打开成功!文件名为:" & objFile.filename else wscript.quit End if
Set objDialog = CreateObject("UserAccounts.CommonDialog") objDialog.Filter = "vbs File|*.vbs" objDialog.InitialDir = "E:" bRet=objDialog.ShowOpen if bRet then strLoadFile = objDialog.FileName Wscript.Echo strLoadFile else Wscript.quit End if