Removing FTP letter restrictions

Discuss all hardware and software modifications
Hatta
Next-Gen
Posts: 4030
Joined: Tue May 06, 2008 8:33 pm

Re: Removing FTP letter restrictions

Post by Hatta »

After you run setup.exe it should leave a "cygwin" icon on your desktop. That will take you to a command prompt running bash. Cygwin sets up a virtual unix system with your windows volumes mounted under /cygdrive. Type 'pwd' to check your current directory. Type 'mount' to see where your volumes are mounted. After just use 'cd' like in DOS to get to the right directory.

Once you're in the right directory, that for loop I posted earlier should work. It will move each file that has a file name greater than 42 characters to the subdirectory 'toolong'. Make sure you create that directory first. Once you have all the long filenames in a subdirectory, you can deal with them as you please.
We are prepared to live in the plain and die in the plain!
User avatar
dlmvii
Next-Gen
Posts: 1156
Joined: Thu Jul 31, 2008 9:12 pm
Location: Madison

Re: Removing FTP letter restrictions

Post by dlmvii »

Just use vbscript if you are running windows, you don't have to install cygwin

copy this text into a file with the extension .vbs (like script.vbs) and run it in the folder you have your roms in, it will put long ones into a too long folder.

'---------------------

On Error Resume Next
Set fso = CreateObject("Scripting.FileSystemObject")
sFolder = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")

Set folder = fso.GetFolder(sFolder)
Set files = folder.Files
Set objFolder = fso.CreateFolder("too long")

For each file In files
If Len(file.Name) > 42 Then
fso.MoveFile file.Name, sFolder & "\too long\"
End If
Next
Wscript.Quit

'-------------
itsmattxp
128-bit
Posts: 600
Joined: Mon Aug 31, 2009 11:18 am

Re: Removing FTP letter restrictions

Post by itsmattxp »

Hatta wrote:After you run setup.exe it should leave a "cygwin" icon on your desktop. That will take you to a command prompt running bash. Cygwin sets up a virtual unix system with your windows volumes mounted under /cygdrive. Type 'pwd' to check your current directory. Type 'mount' to see where your volumes are mounted. After just use 'cd' like in DOS to get to the right directory.

Once you're in the right directory, that for loop I posted earlier should work. It will move each file that has a file name greater than 42 characters to the subdirectory 'toolong'. Make sure you create that directory first. Once you have all the long filenames in a subdirectory, you can deal with them as you please.
Okay I just tried to do this but my computer illteracy is preventing me from succeeding. My roms are on my external HDD so when I put them in are they on my home directory? Or would how would I get it to read my M drive? I have no idea what 'cd" is in DOS because I'm terrible at computers. So I just tried to use the loop that you posted earlier but do not think I am typing it correctly " am I suppose to type "for each in *; do if [$(basename "$each" | wc -c) -gt '42']; then mv "$each" toolong; fi; done" or am I just suppose to type "[$(basename "$each" | wc -c) -gt '42']; then mv "$each" toolong; fi; done". Last I do not know what symbol the bolded is [$(basename "$each" | wc -c) -gt '42']; then mv "$each" toolong; fi; done
itsmattxp
128-bit
Posts: 600
Joined: Mon Aug 31, 2009 11:18 am

Re: Removing FTP letter restrictions

Post by itsmattxp »

dlmvii wrote:Just use vbscript if you are running windows, you don't have to install cygwin

copy this text into a file with the extension .vbs (like script.vbs) and run it in the folder you have your roms in, it will put long ones into a too long folder.

'---------------------

On Error Resume Next
Set fso = CreateObject("Scripting.FileSystemObject")
sFolder = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")

Set folder = fso.GetFolder(sFolder)
Set files = folder.Files
Set objFolder = fso.CreateFolder("too long")

For each file In files
If Len(file.Name) > 42 Then
fso.MoveFile file.Name, sFolder & "\too long\"
End If
Next
Wscript.Quit

'-------------
Okay very useful thanks to everyone that helped. Got it all figured out with this.
Hatta
Next-Gen
Posts: 4030
Joined: Tue May 06, 2008 8:33 pm

Re: Removing FTP letter restrictions

Post by Hatta »

Yeah, but I could do it in one line. :lol:
We are prepared to live in the plain and die in the plain!
User avatar
Hobie-wan
Next-Gen
Posts: 21705
Joined: Sat Aug 15, 2009 8:28 pm
Location: Under a pile of retro stuff in H-town
Contact:

Re: Removing FTP letter restrictions

Post by Hobie-wan »

File Renamer Basic has been pretty good when I had a pile of stuff that needed fixing.
itsmattxp
128-bit
Posts: 600
Joined: Mon Aug 31, 2009 11:18 am

Re: Removing FTP letter restrictions

Post by itsmattxp »

Hobie-wan wrote:File Renamer Basic has been pretty good when I had a pile of stuff that needed fixing.
Didn't really check up on this thread since I used that script but I have found something better. Its like the same thing you posted but specifically for the xbox. Its called Pre xbox copy tool. Hopefully that helps a lot of people in the future.
gtmtnbiker
Next-Gen
Posts: 4320
Joined: Fri Jan 09, 2009 1:14 pm
Location: Massachusetts

Re: Removing FTP letter restrictions

Post by gtmtnbiker »

itsmattxp wrote:Hopefully that helps a lot of people in the future.
Thanks for responding back. It's helpful when people do that. I hate when someone goes off and never supply a solution for the problem they had. Kudos to you!
Post Reply