Search code examples
batch-filejscript

Move downloaded files in to specific folder


My task is to download files from the server using a .bat file. Now here is my problem:

I can download the files manually. Now i want to make it further automated, once i run the .bat file my jscript should run a loop searching for files with specific format (????_dd-MM-YYYY.txt).

Now this (????) is a prefix..i have comp_,faqs_ and so on.

I wanna move comp_ files to the Complaint folder. faqs_ to the Faq folder.( I think i can solve this part)

Now can someone guide me on how to find files with the specific format using jscript.( do i use regex?)

Any help would be wonderful

ps: I don't wanna use wildcards


Solution

  • look into "starts-with" (or maybe it is "startswith") method.