Vbscript get all files in folder and subfolders




















This is definitley a great example. How can it be modified to list files in the main directory and any subdirectories? I'd like to write something that will give me the name, create date, modify date for all files in the main directory and for any files in the sub-directories.

I wrote the following, but it can not handle sub-directories. Any help is appreciated. Files For each folderIdx In files outfile. WriteLine folderIdx. DateLastModified Next outfile. SHARE 9. Hi: I am a novice to VBS. I was wodering if it is possible to read thru the files in a folder and capture the last line in every file csv file and write to a logfile that has the name with date and time Also, is it possible that when capturing the last line , I have to extract the last field value compare it with a base value and if it is greater than the base value then write it the log file.

Since it loops thru each file in the folder, base values for each file keep changing. I am not quite sure how to do it. Any help would be great. Thanks, Yukta. Yukta , Jun 17, Hi, I want one very simple thing but related to what you have done. Code for selecting any excel file previously saved in a given folder and copy that file.

For hottest information you have to pay a quick visit world wide web and on the web I found this web site as a most excellent site for most recent updates. This is brilliant and very close to what I am looking for. I am hoping to be able to tweak this to get it to capture a bit more information. If you are able to point me in the right direction I would be very grateful. I can of course manipulate the data post script but I was hoping to do it within the original code.

What I need to achieve is: All content i. GetFolder WScript. Echo "end. GetFolder fFolder. Seph Seph 8, 10 10 gold badges 60 60 silver badges 90 90 bronze badges. The file extension may be case sentive Name If objFSO. Rafael Herscovici Name Next. Prince Boothe Prince Boothe 29 1 1 bronze badge. How do I find out who downvoted this?

Would like to know why. I hope this is helpful. Marc B. Hankin Marc B. Hankin 3 3 gold badges 13 13 silver badges 25 25 bronze badges. Imane Fateh 2, 3 3 gold badges 17 17 silver badges 23 23 bronze badges.

Eric Eric 11 1 1 bronze badge. You can calculate the folder depth by counting the number of backslashes in the path Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 12 years, 4 months ago. Active 8 years, 4 months ago. Viewed 35k times.

SubFolders Wscript.



0コメント

  • 1000 / 1000