It's not quite clear to me what you really need Bruce, but below is an
example of how to get the list of files for a given dir in VBScript:
set x=getfiles("c:\temp")
' X now holds a dictionary of file names, with the index being an integer
number starting at 1
Function getFiles(ForDir)
Dim fsObj
Dim folder
Dim file
Dim fileList
dim i
Set getFiles = Nothing
Set fileList = CreateObject("scripting.dictionary")
Set fsObj = CreateObject("Scripting.FileSystemObject")
If fsObj.FolderExists(ForDir) Then
Set folder = fsObj.GetFolder(ForDir)
i=0
For Each file In folder.Files
i=i+1
fileList.Add i, file.name
Next
Set getFiles = fileList
End If
End Function
From: BX [mailto:[email protected]]
Sent: Thursday, July 25, 2013 9:32 AM
To: [email protected]
Subject: Can We Call Win32 and shell?
Can we call win32 and shell commands directly using an object create
method in vb?
I have developed a program to extract file names from the clip board and
you can display them as an array or iterate through the array list since the
call back method is an array...
So I need to have win32 and shell in order to get the clipboard handle
then get the DragQueryFile method from the shell because files are on the
system and have to be extracted from the shell.
So, I would like to know how to get that object for the shell and win32.
Could I get the clipboard object without using win32? Since the
clipboard command you have is only for text and someone a while back wanted
to get file names, so I can do that now if I have the way of getting the
shell object from the system without doing the other shell object; yet I may
have answered my question, but still want ideas.
Bruce