Hi Chip, I know how to get files the normal way and someone , besides myself, wanted to get the file list from the clipboard. I have written a version in Python and could write it using studio, but just was asking about using .vbs to get the win32 object which is needed. The only way to get the file list from the clipboard is using shell and that is actually the easy part of getting the file list, in fact very easy. The only other problem is getting into the clipboard commands and that has to be done by win32 commands and Windoweyes does not allow that, they only give properties and 1 method, append
They could easily add isFiles and the object they use for the clipboard itself, for they have to be using it for the few options they have, the only thing missing is the object itself. Now there are memory management calls and such, all under the win32 clipboard command for they use open() and all the other functions. The way to get the file list is to call the shell command: shell.DragDropFile for that is the only way to get the files... So, the only thing I need is the actual clipboard object being used at the window level. Having this feature makes things a lot easier and fast and not requiring another app if it were built into the WE object model. I added another property, pasteFileNames in my code... Bruce Sent: Thursday, July 25, 2013 4:20 PM Subject: RE: Can We Call Win32 and shell? 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:bronx_...@fltg.net] Sent: Thursday, July 25, 2013 9:32 AM To: gw-scripting@gwmicro.com 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