As the Windows NT administrator at your company, you recently started receiving complaints from users who've been having problems copying, editing, saving, and deleting files on the main file server. You've noticed some very long folder names and filenames in your directory. A quick check reveals that one problematic file has a path 270 characters longwell over Windows' 255 path-length limit. You're concerned that the paths to many more files are near or have exceeded the limit and that these long paths are causing the problems users are experiencing with the files.
Rather than manually check all the path lengths in the directory, you want to write a script that automatically locates and reports the names and locations of at-risk files (i.e., files whose paths exceed the Windows' path-length limit or another threshold you specify). You plan to use this report as the basis for corrective actions, such as truncating long folder names and shortening filenames. The script has the following requirements:
- Make the path-length threshold limit configurable.
- Create separate HTML reports for each top-level folder.
- Include the date, path-length threshold, and folder name in each report's heading.
- Identify any paths that exceed the path-length threshold (i.e., the at-risk files).
- Enumerate the absolute path (i.e., the fully qualified path containing drive and directory information) of each at-risk file.
- Specify the path length of each at-risk file.
- Number the files in each report.
- Print a message stating when the script doesn't find any at-risk files.
The script LongPathLocator.pl meets these requirements. To use LongPathLocator.pl, you need to know how the script works and how to prepare your system and the script. . . .
Karen February 07, 2002