|
| | |||||||
| Windows XP Discuss the Microsoft Windows XP Operating System |
| | LinkBack | Thread Tools |
| |||
| 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" |
| Bookmarks |
| Thread Tools | |
| |
| | ||||
| 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? |