Edited based on comments posted later:
To check the file name if it's valid or not on windows....
Due to differences in Windows architecture, the definition of a valid file name may vary depending upon the component of the operating system and file system you are dealing with.
NTFS file system is the most generous in naming files. The name may be up to 32,768 Unicode characters long. The name can contain trailing periods, trailing spaces, and two files may have names that differ only in case e.g., README.TXT and readme.txt.
On Win32 subsystem, the name can be at most MAX_PATH characters long (defined in windef.h as 260 characters), may not have trailing dots or spaces, and file names are not case sensitive.
DOS and 16-bit Windows applications are still limited to 8 character filename plus 3 characters extension.
Based on the operating system you can apply conditional checks in your VB code to verify a filename as valid or you can come up with a regular expression to verify a file name. However, if you want to be precise then refer to a book or some other sources for more information on the different constraints on file names.