Technology Questions

Go Back   Technology Questions > Software Questions > Operating System Questions > Windows XP

Windows XP Discuss the Microsoft Windows XP Operating System

Reply
 
LinkBack Thread Tools
  #16 (permalink)  
Old 11-03-2009, 12:50 PM
Pegasus [MVP]
Newsgroup Contributor
 
Posts: n/a
Re: Windows cannot copy file. The filename or extension is too lon


"Ahmed" <Ahmed@discussions.microsoft.com> wrote in message
news:D8B8F6FC-C211-4AEE-B66A-22ACEF76387D@microsoft.com...
> Thanx again for the script. i just made a small change in it just make it
> easier for me i change the line
> if len(sPath) ^> %Len% then WScript.Echo sPath
> into
> if len(sPath) ^> %Len% then oFile.delete
> hope you dont mind and i ran it as vbscript att log off. i will put it in
> one of my labs 2moro to see if it works coz it worked for me today in my
> test
> workstation.
> some of the website that made the problem are the BBC , the university
> home
> page and youtube and others.


No, I don't mind at all you changing my script - in fact I'm glad you seized
the initiative. On the other hand you need to be aware that deleting files
without user confirmation can cause problems. During the testing phase I
would probably maintain a log like so:

iLen=240
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oWshShell = CreateObject("WScript.Shell")
sFolder = oWshShell.ExpandEnvironmentStrings( _
"%UserProfile%\Local Settings\" _
& "Temporary Internet Files\Content.ie5")
Set oFolder = oFSO.GetFolder(sFolder)
For Each oSubFolder In oFolder.SubFolders
For Each oFile In oSubFolder.Files
sPath = oFile.path
if len(sPath) > iLen then
WScript.Echo sPath
oFile.Delete sPath
end if
Next
Next

Remember to invoke the script like so:
cscript //nologo c:\LongNames.vbs >> "%UserProfile%\My
Documents\LongNames.txt"


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 11-03-2009, 12:50 PM
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
long filename -> short filename conversion incorrect Han Windows XP 7 02-14-2009 08:22 PM
long filename -> short filename conversion incorrect Han Windows XP 7 12-15-2008 08:40 AM
How to display long file names (filename) on the desktop? Peter Windows XP 1 05-02-2008 10:50 AM
Copy folder with long file names dennist Windows XP 6 09-01-2007 10:40 PM
Filename or extension is too long Surana Windows XP 3 05-05-2007 02:05 PM


New To Technology Questions? Do You Need Help with Your Computer or Device? Do You Need Help with this site?

All times are GMT -8. The time now is 07:40 AM.


2003 - 2009 All Rights Reserved. Technology Questions

Search Engine Friendly URLs by vBSEO 3.3.0