View FAQ
Frequently Asked Questions
WebWatchBot General 
NetMailBot General 
Website - General  
NetMailBot Performance 
Watch Item Settings/Configuration 
WebWatchBot Email Settings/Configuration 
NetMailBot Mail Merge & Using a Database 
NetMailBot - Attachments 
WebWatchBot Connectivity - Network - Firewalls 
WebWatchBot Known Issues 
NetMailBot Installation 
NetMailBot Known Issues 
WebWatchBot Installation 
WebWatchBot Errors (Not Relating to Installation) 
WebWatchBot Known Issues - Resolved 
WebWatchBot Performance 
Category NetMailBot - Attachments 
Question/Issue How do I use wildcards with attachments? 
Answer/Solution I'm using a wildcard (*) in my -attachment parameter path because I want to attach any files of a particular type, but it isn't working. How do I use wildcards with attachments?

This is a common confusion. Customers often attempt something like:

-attachment "D:\Reports\CurrentWeek\Rep*.txt"

However, NetMailBot accomplishes the desired effect with the -filemask parameter; the -attachment parameter can be used to specify individual explicitly named files, or the -attachmentdir parameter can be used to specify a directory in which to look (any files appearing there will be attached). -filemask allows you to filter out any files not meeting the specified criterion. So, the above example would be changed to:

-attachmentdir "D:\Reports\CurrentWeek\" -filemask "Rep*.txt"

See the individual parameters' documentation for more details.
Permanent Link 112