A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » General XP issues or comments
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Windows cannot copy file. The filename or extension is too long



 
 
Thread Tools Display Modes
  #16  
Old November 3rd 09, 08:42 PM posted to microsoft.public.windowsxp.general
Pegasus [MVP]
external usenet poster
 
Posts: 2,361
Default Windows cannot copy file. The filename or extension is too lon


"Ahmed" wrote in message
news
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"


Ads
  #17  
Old November 8th 13, 11:18 AM posted to microsoft.public.windowsxp.general
leslysab
external usenet poster
 
Posts: 1
Default Windows cannot copy file. The filename or extension is too long

Ahmed wrote on 10/28/2009 05:03 ET :
hey
we are having this new problem in our labs that windows create the mandatory
profile which is located locally in the same workstation becouse there is a
file thats too long in the temporary internet files. the profile should be
deleted on log off but it does not for a reason that i dont know or becouse
it is locked. i tried using the UPHclean up "both the old the new and the
beta" and it didnt work. i tried to put a log off script to delete the
profile but it works only when we log in as admin. this problem is killing
me. any help will be appriciated.

Download Long Path Tool it will do the job for you guaranteed fix
  #18  
Old November 8th 13, 11:57 AM posted to microsoft.public.windowsxp.general
David H. Lipman
external usenet poster
 
Posts: 4,185
Default Windows cannot copy file. The filename or extension is too long

From: "leslysab"

Ahmed wrote on 10/28/2009 05:03 ET :
hey
we are having this new problem in our labs that windows create the mandatory
profile which is located locally in the same workstation becouse there is a
file thats too long in the temporary internet files. the profile should be
deleted on log off but it does not for a reason that i dont know or becouse
it is locked. i tried using the UPHclean up "both the old the new and the
beta" and it didnt work. i tried to put a log off script to delete the
profile but it works only when we log in as admin. this problem is killing
me. any help will be appriciated.

Download Long Path Tool it will do the job for you guaranteed fix


Do not follow the suggesting of this spammer replying to a post from 2009 !

One can always use the SUBSTitute command and create a drive letter within the path and
manipulate the file and or path to be withing the NTFS max. length.



--
Dave
Multi-AV Scanning Tool - http://multi-av.thespykiller.co.uk
http://www.pctipp.ch/downloads/dl/35905.asp


  #19  
Old October 27th 15, 01:50 PM posted to microsoft.public.windowsxp.general
robertvo
external usenet poster
 
Posts: 1
Default Windows cannot copy file. The filename or extension is too long

I have used Long Path Tool when i see my filename or extension is too long. I did not get yet any problem.
 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 05:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.