.:: Jasa Membuat Aplikasi Website,Desktop,Android Order Now..!! | | Order Now..!! Jasa Membuat Project Arduino,Robotic,Print 3D ::.

Folder Renamer

0 komentar


بِسْــــــــــــــــمِ اﷲِالرَّحْمَنِ اارَّحِيم
bismillaahirrahmaanirrahiim

السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ
Assalamu'alaikum warahmatullahi wabarakatuh

Folder Renamer

With source code in visual basic. Free to use.


hyphen
Last afternoon, I when to a little party for my friend�s wife in the restaurant: Pacini at Sainte-Julie in the Qu�bec Province. I take a lot of picture with my camera from Canon. Using the ZoomBrowser Ex from Canon, I could easily import all the pictures I want in my computer. The program automatically creates folder and sob folder based on the year, the month, the day and a description. Cool! But the problem is the date separator. All the folders created with the Canon�s ZoomBrowser Ex uses underscore �_� and I want to use hyphen �-�. I checked everywhere in that software I haven�t found any option related to the separator. What happens if I have a lot of pictures in a lot of folder? I have to rename then one by one? No way!
Honestly, I love my little camera from Canon and I like to use the importer for years, but I never thought I could program a little program to rename my folder the way I would like them.  Today, I decided to program a little application to help me rename all the folders under my Pictures folders. That way, I won�t have to look for a folder because they are sorted differently because of the underscore versus hyphen.



For those who want to download my program, there is no problem. The program is free to use. Otherwise, I will take one moment to explain the code.

form1

To make a program that renames all my folders under my Pictures Folder, I used a few objects:

  1. FolderBrowserDialog
  2. TextBox
  3. Button
  4. Checkbox
  5. Form


I think that is all.

I also use my same find files and find directory from one of my previous post: search file - Improve performance
I slightly change it to handle sub-folders. I also use two TextBox to get the character to find and another to replace. Here is a piece of code written in Visual Basic:


For Each foundDirectory As String In My.Computer.FileSystem.GetDirectories(dirPath, FileIO.SearchOption.SearchTopLevelOnly, String_to_Search)

               Dim aArray() As String = foundDirectory.Split("\")
                Dim sFolder1 As String = aArray(aArray.Length - 1)
                Dim sFolder2 As String = sFolder1.Replace(TextBox2.Text, TextBox3.Text)
                My.Computer.FileSystem.RenameDirectory(foundDirectory,
sFolder2)

            Next


Yes I know, I declare the variable inside the FOR loop and I know is not a good practice. Sorry, I only want to show something quickly and I wanted to preserve one of the previous codes.
I use the �My.Computer.FileSystem.RenameDirectory� method to rename each directory that contains the little keyword. That keyword is in TextBox2. I replace it with the character inside TextBox3.

I also use the method �My.Computer.FileSystem.GetDirectories� to easily retrieve all folders that matches TextBox2.

renamed
Of course, I made this quickly; there is not enough robustness in the programming. We have to check if the path doesn�t exceed the system-defined maximum length. You could read this interesting article: Long Paths in .NET, Part 1 of 3 [Kim Hamilton]. Also have to make sure the inside TextBox1, it doesn�t contain any invalid path, empty path or anything with invalid char such as the semi- colon �:�. You also have to make sure TextBox1 is not a relative path that starts with �\\� or �\�.
Inside the code, I also put very basic permission verification. You have to put more stuff to make the program better. (I haven�t).



Reference:

Project with code sample : ReplaceCharInFolder.zip
Download the program from this page : Folder Renamer Download

http://www.pacini.ca/qc/



SQL Server Developer Edition 2012 and Microsoft Visual Studio Pro 2012 are very cheap on Amazon ! Free Delivery. Check here:
  





Update Contact :
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email : Fajarudinsidik@gmail.com
NB :: Bila Sobat tertarik Ingin membuat software, membeli software, membeli source code, membeli hardware elektronika untuk kepentingan Perusahaan maupun Tugas Akhir (TA/SKRIPSI), Insyaallah Saya siap membantu, untuk Respon Cepat dapat menghubungi kami, melalui :

No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email: Fajarudinsidik@gmail.com


atau Kirimkan Private messanger melalui email dengan klik tombol order dibawah ini :

ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِين
Alhamdulilah hirobil alamin

وَ السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ
wassalamualaikum warahmatullahi wabarakatuh


Artikel Folder Renamer, Diterbitkan oleh scodeaplikasi pada Senin, 22 April 2013. Semoga artikel ini dapat menambah wawasan Anda. Website ini dipost dari beberapa sumber, bisa cek disini sumber, Sobat diperbolehkan mengcopy paste / menyebar luaskan artikel ini, karena segala yang dipost di public adalah milik public. Bila Sobat tertarik Ingin membuat software, membeli software, membeli source code ,Dengan Cara menghubungi saya Ke Email: Fajarudinsidik@gmail.com, atau No Hp/WA : (fajar) : 085369237896, (puat) : 085267792168.

Tawk.to