Vbscript read files in folder


















In the zip file is the VBS file that performs the operation for you. Some changes may be required but nothing too tough. Red Flag This Post Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework. The Tek-Tips staff will check this out and take appropriate action.

Click Here to join Tek-Tips and talk with other members! Already a Member? Join your peers on the Internet's largest technical computer professional community. It's easy to join and it's free. Register now while it's still free! Already a member? Viewed 3k times. My script works but onl for one directory. OpenTextFile file. AtEndOfStream If instr testfile. There tools for this task - e. Use them or state why not. I really want to use VBS cause i have spend much time to come there.

Now if only i can use it in subfolders i would be proud of me i am beginner — user Add a comment. Active Oldest Votes.

One remark about your existing code, though: each call of the ReadLine method reads the next line from the file, so something like this: If instr testfile. WriteLine line End If. Community Bot 1 1 1 silver badge. Ansgar Wiechers Ansgar Wiechers k 23 23 gold badges silver badges bronze badges. I think I should go to bed now Search objFSO. Close Sub Search sDir for each file in sDir. For Each subFolder In sDir.

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, SHARE Hallo This is what i was surching for a very long time. But i must filter the files i want listed in the. Dis is great Keep it up. SaswatPadhi , Sep 24, Well that did the trick. My pleasure. How do i code such that, the filename that is captures will be stored into an array of strings?

DivinationX , Nov 13, Is it possible to tiune this skript, so I get a file contianing fileextention, size and owner of the file? I found something similar in asp: classicasp.



0コメント

  • 1000 / 1000