This Small Code Helps us to Rename file in the Folder… Be Carefull with it..
If Directory.Exists(TextBox1.Text) Then
If Not TextBox2.Text = "" Then
Dim str As String
Dim ct As Integer
ct = 0
Try
For Each element As String In Directory.GetFiles(TextBox1.Text)
ListBox1.Items.Add(element)
str = TextBox1.Text & "\" & TextBox2.Text & " " & ct & ".jpg"
File.Move(element, str)
ct += 1
Next
Catch ex As Exception
MsgBox(ex.ToString)
End Try
For Each element As String In Directory.GetFiles(TextBox1.Text)
ListBox2.Items.Add(element)
Next
Else
MsgBox("Value Missing")
End If
Else
MsgBox("Directory Not Found")
End If
Textbox1 gets the folder name and textbox 2 gets the custom file name… suppose if folder name is,
c:\myname\myfiles
and if all files inside my files should be renamed to file 1, file 2 etc.. then in textbox2 we should give file. Be Careful with Extensions..
]]>Well first problem that i had after upgrading is that i lost my shortcut of “devenv” which should open vs 2010 but it opened vs 2008…. as the executable’s of both versions are same, we either need to change the Command Text of Devenv or we have to do a small edit in registry path…
For Registry:
GOTO:
First type “regedit” in rum command and press enter.. then navigate to below path.
\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\devenv.exe
Now double click the value on right side and change from
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe
to
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
Thats it Guys!!!!
]]>