Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


December 17, 1999

Real-World Scripting: Locating Long Paths in a Directory


RSS
View this exclusive article with VIP access -- click here to join |
See More Systems Administration Articles Here | Reprints | Or sign up for our VIP Monthly Pass!

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 long—well 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. . . .


Already a VIP member?
Please log on to view the full article

Why become a VIP member?

VIP-only online access
VIP CD delivered twice a year: offline access to the entire Windows IT Pro article library
Monthly issue of your choice of Windows IT Pro or SQL Server Magazine

Subscribe Now
Reader Comments
<p>I am very new to scripting and I was wondering if someone might be able to help me. I am trying to run the LongPathLocator.pl script but when I attempt to install ActivePerl, I receive the following error: <i>Internal Error 2755. 1632 C:\Perl\ActivePerl-5.6.1.631-MSWin32-x86.msi.</i> Does anyone know what the problem might be? Please excuse my ignorance on this topic.</p>

Karen February 07, 2002


<p>Without further information, identifying the problem is difficult. The problem could be one of many. For example, you might be using the incorrect Perl version for your operating system or you might need to install Windows Installer to install the MSI file.</p>

Dick Lewis February 19, 2002


You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
Battery Life Issues Almost Certainly Not Windows 7's Fault

While Microsoft is still investigating a notebook battery life issue that was supposedly caused by Windows 7, some interesting trends have emerged. ...

Getting your iPhone to Sync with Exchange 2003

Follow these steps to use an iPhone with Exchange. ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...


Scripting Whitepapers Three Ways to Prevent Insider Risk within Your SCCM-Managed Environment

From Development to Production: Streamlining SharePoint Deployment with DocAve Deployment Manager

Related Events Configuration Manager SP1 and R2 Overview

Check out our list of Free Email Newsletters!

Scripting eBooks Keeping Your Business Safe from Attack: Encryption and Certificate Services

Best Practices for Managing Linux and UNIX Servers

Building an Effective Reporting System

Related Scripting Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2010 Penton Media, Inc. Terms of Use | Privacy Statement