Originally posted by 3742668 at 2006-8-2 11:39:
1, For the case of selecting at least two files, you can add an if statement by yourself to judge. How much improvement can there be by just copying others' code?
2, It's not that you can't input long file names with spaces, but...
What I'm saying is calling VBS multiple times, inputting single or multiple files in the input box
1、
set objFile = CreateObject("SAFRCFileDlg.FileOpen")
intRet = objFile.OpenFileOpenDlg
Wscript.StdOut.Write objFile.FileName
This can only input a single file each time
2、
Set objDialog = CreateObject("UserAccounts.CommonDialog")
objDialog.Filter = "VBScript Scripts|*.vbs|All Files|*.*"
objDialog.Flags = &H0200
objDialog.FilterIndex = 1
objDialog.InitialDir = "e:\"
intResult = objDialog.ShowOpen
If intResult = 0 Then
Wscript.Quit
Else
arrFiles = Split(objDialog.FileName, " ")
For i = 1 to Ubound(arrFiles)
strFile = arrFiles(0) & arrFiles(i)
Wscript.Echo strFile
Next
End If
And this can only input at least two files each time, not single ones
If you modify some parameters, you can input a single file alone, but when inputting two or more, there will be N+1 variables, and the first one is empty
In addition: Can the second one not automatically replace the long file name with the 8.3 short name?