Anyone knows a script that will rename a thousand filenames in a folder.. example: from filename samp to samp.htm
In windows-> select all files -> right click any one file -> rename that file -> rest files will be automatically renamed.
it's not working.. correct me if i'm wrong... when you select all files all files are highlighted.. when you right click a particular file.. is it natural that when you right click it the highlight to the other files are gone? so the one highlighted is the only filename will be renamed
Use the Acdsee application. It has a rename feature where you can rename whatever number of files into whatever filenames.
you're right i forgot to mention my OS it's Windows 98 but i tried it in Xp and it works.. but that's not the result I expected....... let say i've thousand txt filenames and i want to make it html files by adding .html at the end of it's filename.. the recent solution add an extra array type word on every filename...
Hmm...I dont know of a way to do this in javascript. Depending on your platform, its a simple script though. If windows, write a batch file you run from your DOS prompt to loop through all files in a directory, and run the move or rename command on it (can't remember if DOS has a rename or not). If in unix/linux/mac, write a shell script to loop through them all and run the mv command on the files to give it the new name. In your case, it should be easy because your not dramatically changing the strutuce of the filename, your just appending onto it. So in unix, the mv command would look something like: mv $FILENAME $FILENAME.htm You can probably also use any programming language to do this that your comfortable with: PERL, Java, C, PHP, etc.. I dont think javascript will work though...If anyone knows how to manipulate the filesystem using javascript in a cross platform compatible way, please let me know I'd love to learn how that works. Thanks! Tim
When you rename a file with .txt extension with .htm then it automatically changed it file type from text file to html file Am I correct?
The contents of the file remain unchanged. Only the filename itself is changed. Additionally, opening an HTML file will open in your default browser instead of Notepad. This might make it look different, but it's still just a text file with an HTML extension. As far as renaming files with javascript, you would have to look into the FileSystemObject and of course, the javascript file would have to be a .js file that you run locally on your machine; script within a webpage cannot access your file system. Alternatively, you could just open the command prompt and type ren *. *.html (assuming that you are using Windows, the original files have no extension, and you want to give them all an HTML extension).
This can easily be done with a simple Java program. PM me if you would like me to code you something quickly.
i dont thing thats possible with js, try doing it with some ani other High-level programming language.
These files are on your computer? Use this app to do it. Rename Master, its free: http://www.snapfiles.com/get/renamemaster.html Replace tab has replace extension.