Click here to Skip to main content
15,912,329 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Just a link required Pin
Аslam Iqbal22-Feb-11 4:01
professionalАslam Iqbal22-Feb-11 4:01 
QuestionFloating point with VB Slider Control? Pin
mathivanaan16-Feb-11 17:32
mathivanaan16-Feb-11 17:32 
AnswerRe: Floating point with VB Slider Control? Pin
Dalek Dave16-Feb-11 22:09
professionalDalek Dave16-Feb-11 22:09 
AnswerRe: Floating point with VB Slider Control? Pin
Richard MacCutchan16-Feb-11 22:12
mveRichard MacCutchan16-Feb-11 22:12 
AnswerRe: Floating point with VB Slider Control? Pin
Mycroft Holmes17-Feb-11 13:49
professionalMycroft Holmes17-Feb-11 13:49 
GeneralRe: Floating point with VB Slider Control? Pin
Richard MacCutchan17-Feb-11 22:19
mveRichard MacCutchan17-Feb-11 22:19 
GeneralRe: Floating point with VB Slider Control? Pin
Mycroft Holmes17-Feb-11 23:29
professionalMycroft Holmes17-Feb-11 23:29 
QuestionSearch File Name - Change Name to Parent Folder Name.vbs ** Question! Pin
Memphis7616-Feb-11 11:54
Memphis7616-Feb-11 11:54 
Hi there,
I'm sorry to bug, but I have been searching today for something like the code I did (see bellow) and I couldn't really find anything alike so I took some ideas and added some lines and so far it worked on a test folder (drilling down through sub-folders and different ext, etc)
What I need is some guidance and just for you to take a look at the code and let me know if there is a way to improve it and/or bullet proof it. I do have more than 25k files to update and I don't want to do it later on manually!
The information to be updated are movie files The Folder has a name (Sample: SQL.Proyect.20100525) But the movie was named just "Movie", and I need to update that. The path looks like (Z:\20\1\0\SQL.Proyect.20100525\Movie.avi)
One more thing: Keep in mind that I just learned today .vbs Smile | :)
So your expertise will be much appreciate it!
<br />
Option Explicit<br />
Dim objFSO, strDIR, objDIR<br />
Set objFSO = CreateObject("Scripting.FileSystemObject")<br />
strDIR = "C:\vbScript"<br />
Set objDIR = objFSO.GetFolder(strDIR)<br />
RenameVideos(objDIR)<br />
Sub RenameVideos(curPath)<br />
Dim vItem, vCurName, vCurPath, vNewName, vNewPath, vShwName<br />
	For Each vItem In curPath.Files<br />
		If objFSO.GetBaseName(vItem.Path) = "Movie" Then<br />
			vCurName = objFSO.GetFileName(vItem.Path)<br />
			vCurPath = objFSO.GetParentFolderName(vItem.Path) & "\" & objFSO.GetFileName(vItem.Path)<br />
			vShwName = objFSO.GetParentFolderName(vItem.Path)<br />
			vNewName = objFSO.GetBaseName(vShwName) & "." & objFSO.GetExtensionName(vCurName)<br />
			vNewPath = objFSO.GetParentFolderName(vItem.Path) & "\" & objFSO.GetFileName(vNewName)<br />
			Wscript.Echo "The File Name: " & vCurName & chr(13) & _<br />
				     "Location Path: " & vCurPath & chr(13) & _<br />
				     "Will be renamed to: " & vNewName & chr(13) & _<br />
				     "New Unique Path: " & vNewPath<br />
		        objFSO.MoveFile vCurPath, vNewPath	 <br />
		End If<br />
	Next<br />
	For Each vItem In curPath.SubFolders<br />
		RenameVideos(vItem)<br />
	Next<br />
End Sub<br />

AnswerRe: Search File Name - Change Name to Parent Folder Name.vbs ** Question! Pin
DaveAuld16-Feb-11 12:57
professionalDaveAuld16-Feb-11 12:57 
QuestionGlobal search? Pin
waner michaud16-Feb-11 9:31
waner michaud16-Feb-11 9:31 
AnswerRe: Global search? Pin
Luc Pattyn16-Feb-11 10:11
sitebuilderLuc Pattyn16-Feb-11 10:11 
GeneralRe: Global search? Pin
waner michaud16-Feb-11 13:49
waner michaud16-Feb-11 13:49 
AnswerRe: Global search? Pin
Luc Pattyn16-Feb-11 13:58
sitebuilderLuc Pattyn16-Feb-11 13:58 
GeneralRe: Global search? Pin
waner michaud16-Feb-11 14:13
waner michaud16-Feb-11 14:13 
AnswerRe: Global search? Pin
Luc Pattyn16-Feb-11 14:18
sitebuilderLuc Pattyn16-Feb-11 14:18 
GeneralRe: Global search? Pin
waner michaud16-Feb-11 15:01
waner michaud16-Feb-11 15:01 
AnswerRe: Global search? Pin
Luc Pattyn16-Feb-11 15:08
sitebuilderLuc Pattyn16-Feb-11 15:08 
GeneralRe: Global search? Pin
waner michaud16-Feb-11 15:22
waner michaud16-Feb-11 15:22 
GeneralRe: Global search? Pin
waner michaud18-Feb-11 7:01
waner michaud18-Feb-11 7:01 
GeneralRe: Global search? Pin
Luc Pattyn18-Feb-11 7:22
sitebuilderLuc Pattyn18-Feb-11 7:22 
GeneralRe: Global search? Pin
waner michaud18-Feb-11 7:44
waner michaud18-Feb-11 7:44 
GeneralRe: Global search? Pin
waner michaud18-Feb-11 9:44
waner michaud18-Feb-11 9:44 
GeneralRe: Global search? Pin
Luc Pattyn18-Feb-11 17:13
sitebuilderLuc Pattyn18-Feb-11 17:13 
AnswerRe: Global search? Pin
Bernhard Hiller16-Feb-11 23:26
Bernhard Hiller16-Feb-11 23:26 
QuestionSynchronizing in VB 6.0 [modified] Pin
Harsha Kadekar15-Feb-11 19:36
Harsha Kadekar15-Feb-11 19:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.