hebi Posted October 15, 2004 Posted October 15, 2004 Sorry, maybe I'm too stupid but i cant find a command that copies all the content of a directory to another directory including subdirs can anyone help me out?
Matt @ MPCS Posted October 15, 2004 Posted October 15, 2004 I guess FileCopy would be too obvious? *** Matt @ MPCS
hebi Posted October 15, 2004 Author Posted October 15, 2004 I guess FileCopy would be too obvious?*** Matt @ MPCS<{POST_SNAPBACK}>including subdirs?
Matt @ MPCS Posted October 15, 2004 Posted October 15, 2004 including subdirs? <{POST_SNAPBACK}>I didnt think I should have to point it out but how about DirCopy???*** Matt @ MPCS
hebi Posted October 15, 2004 Author Posted October 15, 2004 (edited) I didnt think I should have to point it out but how about DirCopy???*** Matt @ MPCS<{POST_SNAPBACK}>not the dir itself only the content of a directorylike this:cp -R C:/dummy/* C:/dummy/ Edited October 15, 2004 by hebi
Matt @ MPCS Posted October 15, 2004 Posted October 15, 2004 So you want to copy the files of a tree but not the tree structure itself? *** Matt @ MPCS
hebi Posted October 15, 2004 Author Posted October 15, 2004 ok: i want to copy the content (with all subdirs and trees and blah) of direcotry A to direcotry B in unix: cp -R /dummy/* /dummy2/
Matt @ MPCS Posted October 15, 2004 Posted October 15, 2004 If you have a tree that looks like this: / -etc --subfolder ---subfile1 --file1 -etc2 and you execute the command cp -R /etc /etc2 do you expect the new tree to look like: / -etc --subfolder ---subfile1 --file1 -etc2 --subfolder ---subfile1 --file1 or: / -etc --subfolder ---subfile1 --file1 -/etc2 --file1 --subfile1 ? *** Matt @ MPCS
hebi Posted October 15, 2004 Author Posted October 15, 2004 / -etc --subfolder ---subfile1 --file1 -etc2 --subfolder ---subfile1 --file1 like that ^^^
Matt @ MPCS Posted October 15, 2004 Posted October 15, 2004 (edited) Ok there is not a command... you can use windows copy using the runwait function... or manipulate the script on this thread to get what you are looking for.*** Matt @ MPCSEDIT: fixed link Edited October 15, 2004 by Matt @ MPCS
emmanuel Posted October 15, 2004 Posted October 15, 2004 Ok there is not a command... you can use windows copy using the runwait function... or manipulate the script on this thread to get what you are looking for.*** Matt @ MPCSEDIT: fixed link<{POST_SNAPBACK}>um, why not FileCopy("C:\dir1\*.*", "C:\dir2\*.*") ? FileCopy will copy directories. "I'm not even supposed to be here today!" -Dante (Hicks)
hebi Posted October 15, 2004 Author Posted October 15, 2004 i did something like the runwait command too $destination = StringFormat("%s",$instpath) $source = StringFormat("%s\Server",$source) $command = StringFormat("xcopy %s %s /E /M",$source,$destination) RunWait($command) but the problem is: IT's not working when one of the paths has a space in it C:\My Documents <-will not work.. this drives me sad because i cant add some " in the code (
Developers Jos Posted October 15, 2004 Developers Posted October 15, 2004 ok: i want to copy the content (with all subdirs and trees and blah) of direcotry A to direcotry Bin unix:cp -R /dummy/* /dummy2/<{POST_SNAPBACK}>like Xcopy c:\dummy\*.* c:\dummy2 /sorDircopy("c:\dummy" ,"c:\dummy2",1) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Developers Jos Posted October 15, 2004 Developers Posted October 15, 2004 (edited) read above<{POST_SNAPBACK}>saw that after the post... however:Dircopy("C:\My Documents\source" ,"C:\My Documents\target",1)should work... Edited October 15, 2004 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
emmanuel Posted October 15, 2004 Posted October 15, 2004 i did something like the runwait command too$destination = StringFormat("%s",$instpath) $source = StringFormat("%s\Server",$source) $command = StringFormat("xcopy %s %s /E /M",$source,$destination) RunWait($command)but the problem is: IT's not working when one of the paths has a space in itC:\My Documents <-will not work.. this drives me sad because i cant add some " in the code (<{POST_SNAPBACK}>if something doesn't work because it has a space in the path, what do you do? put quotes around it. It has to do with FAQ 7I don't know what you're doing with the string format, but here's how I'd do it...runwait( @comspec & ' /c xcopy "' & $source & '" "' & $destination & '" /E /M')that will put double quotes around the souce and the destination. "I'm not even supposed to be here today!" -Dante (Hicks)
hebi Posted October 15, 2004 Author Posted October 15, 2004 damn thank ya! i was looking for this the hole day but search for (") didn't match
emmanuel Posted October 15, 2004 Posted October 15, 2004 saw that after the post... however:Dircopy("C:\My Documents\source" ,"C:\My Documents\target",1)should work...<{POST_SNAPBACK}>being as I'm to lazy to test, I believe that would result in "c:\my documents\target\source" not the contects of \source within target directly... "I'm not even supposed to be here today!" -Dante (Hicks)
Developers Jos Posted October 15, 2004 Developers Posted October 15, 2004 being as I'm to lazy to test, I believe that would result in "c:\my documents\target\source" not the contects of \source within target directly...<{POST_SNAPBACK}>don't think so.... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
emmanuel Posted October 15, 2004 Posted October 15, 2004 don't think so.... <{POST_SNAPBACK}>damn. why do I even try? you're right. though, if the destination exists, even if it's empty, you need the 1 "I'm not even supposed to be here today!" -Dante (Hicks)
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