smstroble Posted September 29, 2006 Share Posted September 29, 2006 (edited) Ok i must be missing something here. im trying to move the contents of a folder but not the folder its self. Filemove("sourcefoler\*", "destnationfolder", 1) works greak for the files but i cant figure a way to move the folders in the folder, using DirMove which moved the source folder which i dont want to do. is there anyway to search for the subdirectorys within a directory? thanks for your help Edited September 30, 2006 by smstroble MUHAHAHAHAHA Link to comment Share on other sites More sharing options...
cppman Posted September 30, 2006 Share Posted September 30, 2006 (edited) #include <file.au3> Func _MoveFilesAndDirectories($srcFolder, $srcDest) Local $avFilesArray = _FileListToArray($srcFolder) For $i = 1 to $avFilesArray[0] if (FileGetSize($avFilesArray[$i]) <= 0) Then ;Checks if its a folder or a file. DirCopy($srcFolder & "\" & $avFilesArray[$i], $srcDest & "\" & $avFilesArray[$i] & "\") Else FileCopy($srcFolder & "\" & $avFilesArray[$i], $srcDest & "\" & $avFilesArray[$i]) EndIf Next EndFunc _MoveFilesAndDirectories("Glib", "test") hmm, this seems to work for me Thats what you're looking for right? Edited September 30, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
smstroble Posted September 30, 2006 Author Share Posted September 30, 2006 (edited) Thanks so much, been looking for this for hours.. knew i was missing something simple. Edited September 30, 2006 by smstroble MUHAHAHAHAHA Link to comment Share on other sites More sharing options...
smstroble Posted September 30, 2006 Author Share Posted September 30, 2006 (edited) hmm dident work quite right.. so i fixed it! Func _MoveFilesAndDirectories($srcFolder, $srcDest) Local $avFilesArray = _FileListToArray($srcFolder) For $i = 1 To $avFilesArray[0] if (FileGetSize($srcFolder & "\" & $avFilesArray[$i]) <= 0) Then ;Checks if its a folder or a file. DirMove($srcFolder & "\" & $avFilesArray[$i], $srcDest & "\" & $avFilesArray[$i]) Else FileMove($srcFolder & "\" & $avFilesArray[$i], $srcDest & "\", 8) EndIf Next EndFunc edit: minor code simplification Edited September 30, 2006 by smstroble MUHAHAHAHAHA Link to comment Share on other sites More sharing options...
cppman Posted September 30, 2006 Share Posted September 30, 2006 (edited) ah! I forgot to add the $srcFolder & "\". lol. Strange though because it worked for me.. sry Edited September 30, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
smstroble Posted September 30, 2006 Author Share Posted September 30, 2006 FileCopy($avFilesArray[$i] very strange indeed you dident close the () for the filecopy function anyway np thanks much for the help incase your wondering what im working on im makeing a "real" desktop switcher. real meaning it will have unique desktop icons/items for each virtual desktop. only been able to find one other program like it and its $25 MUHAHAHAHAHA Link to comment Share on other sites More sharing options...
cppman Posted September 30, 2006 Share Posted September 30, 2006 (edited) hmmmmm.... maybe i accidently erased that when i was editing it but np. Sounds like a nice prgram! Edited September 30, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now