Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
i have a script which watches a folder for new files to appear. when a new file does appear, i want to be able to put its filename into a variable that i can use in other parts of the script.
example would be that folder x has 10 files in it.
when file 11 arrives, the filename is read into variable y so that the script can later say things like:
copy y to folder z,
move y to folder a,
loop back to monitoring for new input.all the examples i see for parsing a filename seem to come from user input rather than something read from within the system.
thanks for any help or linlks,
BabaG

BabaG, it's been YEARS since I did any serious programming so this might be way out of date. Back then, a variable defaulted to a numeruc variable and you had to specifically state that variable 'y' was a string variable capable of accepting alpha data. Maybe??
HTH.
Ed in Texas.

Why don't you have your script do something like this...
Read the contents of FolderX and put the current list into a text file somewhere.
Have the script compare the contents of FolderX with the list as needed. If there are new files, process them as desired, and generate a new text file with the updated FolderX contents...

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |