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. |
|
|
|
Thread Tools | Display Modes |
#16
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|