usera Posted May 11, 2009 Share Posted May 11, 2009 Greeting, I have questions about the move the folder. for example in c:\ has a folder call test, under test has 2 folders call loc1 and loc2, in loc1 has some files and sub folder called loc1sub1, some files and sub folder in locsub1 as well. I want to move everything under loc1 to loc2, how to do that. Thanks usera before =========================== c:\test \loc1 \ file1 \ file2 \ ....... \ loc1sub1 \file3 \file4 ....... \loc1sub1sub1 \file5 ..... \loc2 I am looking for ============================== c:\test \loc1 \loc2 \ file1 \ file2 \ ....... \ loc1sub1 \file3 \file4 ....... \loc1sub1sub1 \file5 ..... Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 11, 2009 Moderators Share Posted May 11, 2009 If you're trying to move the entire Loc1 directory into Loc2 (Where Loc1 will now be in Loc2), then all you need is DirMove(). If you only want to move the contents, then you could do: _FileListToArray($s_path_dir, "*") For/Next loop If StringInStr(FileGetAttrib(File), "D") Then ; Check FileGetAttrib() (This will validate if the file is a directory) DirMove() Else FileMove() Endif Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
usera Posted May 12, 2009 Author Share Posted May 12, 2009 Thanks, Dirmove() works for me. But if I want to remove everything from my desktop to the another folder then it fail. for example, I want to move C:\Documents and Settings\MYACCOUNT\Desktop to c:\backups dirmove("C:\Documents and Settings\MYACCOUNT\Desktop","c:\backups") it won't work. Do you know why? is it because the desktop is the system file? And what is the solution if I want to remove everything from my desktop to the another folder? Thanks usera If you're trying to move the entire Loc1 directory into Loc2 (Where Loc1 will now be in Loc2), then all you need is DirMove(). If you only want to move the contents, then you could do: _FileListToArray($s_path_dir, "*") For/Next loop If StringInStr(FileGetAttrib(File), "D") Then ; Check FileGetAttrib() (This will validate if the file is a directory) DirMove() Else FileMove() Endif Link to comment Share on other sites More sharing options...
DaRam Posted May 12, 2009 Share Posted May 12, 2009 Yes, Desktop is a system created/managed folder, that is why. If you are migrating users, MS has a KB article which essentially states, you have to be logged on as a different ADMIN user to do this. Link to comment Share on other sites More sharing options...
usera Posted May 12, 2009 Author Share Posted May 12, 2009 Thank DaRam,it that is the case, how can I move the files and folders on the desktop to another folder? I mean use another functions?Really needs to do that,Thanks Yes, Desktop is a system created/managed folder, that is why.If you are migrating users, MS has a KB article which essentially states, you have to be logged on as a different ADMIN user to do this. Link to comment Share on other sites More sharing options...
DaRam Posted May 12, 2009 Share Posted May 12, 2009 As I wrote, by logging on as a different User with Admin privileges, Copying (NOT Moving) the folder and then deleting the User.Thank DaRam,it that is the case, how can I move the files and folders on the desktop to another folder? I mean use another functions?Really needs to do that,Thanks Link to comment Share on other sites More sharing options...
usera Posted May 12, 2009 Author Share Posted May 12, 2009 Idea is good, but not fit for my request, I do not want to delete the Desktop folder, just move everything from there to another folder, still keep Desktop folder.ThanksAs I wrote, by logging on as a different User with Admin privileges, Copying (NOT Moving) the folder and then deleting the User. Link to comment Share on other sites More sharing options...
CodyBarrett Posted May 13, 2009 Share Posted May 13, 2009 filecopy? for each file [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
usera Posted May 13, 2009 Author Share Posted May 13, 2009 Good idea, but how to dealing with the files in sub-folder, and sub-folder in another sub-folder?filecopy? for each file Link to comment Share on other sites More sharing options...
CodyBarrett Posted May 13, 2009 Share Posted May 13, 2009 dircopy? like use a recursive filefind function.. get the files and Dirs and then filecopy a file.. and dircopy a directory [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] 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