Copy folder or file.

New to Windows PowerShell.
I want to automate a tedious procedure.
Is there a line(s) of code that will copy a folder or file from an SD memory card or USB flash drive to an external hard drive?
Thanks in advance for any help.

yep, the simple Copy-Item cmdlt can do that, like:
Copy-Item -Path "d:\folder1" -Destination "e:\folder2" -Recurse
Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable)

Similar Messages

  • How to copy folder with files and subfolders within it  to another folder

    how to copy a folder with files and subfolders within it to another folder

    http://javaalmanac.com/egs/java.io/CopyDir.html?l=new

  • Copy folder with files in structured format

    All Experts,
    I am new to indesign and javascripting. i need to copy the folder with files (structured folder) from one location to another location with the same folder name. i tried the file copy file.copy(), this is copying only particular file, i need to copy the folder with structured format. ie folder, if any sub folder...
    Thanks,
    sag

    Sorry for the delay in response.
    I assume both sagkrish and Mac_06 are either the same person or working together?
    When you said:
    when we execute your code it's showing error "cannot compile the script".
    were you trying after fixing the missing double-quote (my post of 1:42am)?
    If not, maybe one of the Windows folks could better advise. The official Microsoft help for XCOPY is http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx? mfr=true that might be differently helpful than Jongware's link, which is good, too.
    I can't quite tell if you're having a problem if you run the XCOPY command from the CMD.EXE Windows Command Prompt. If you are, well, it's not really an InDesign scripting question, but maybe we can help you anyhow. But you'll need to give us a lot more specifics on what is breaking. Does it work with other directories? Are there network filesystems involved? Are the source and destination directories outside of the running user's home folder?
    If you're having problems overwriting files, you might try adding /R.
    (Does anybody else want to test it?)

  • Copying folder of files to external drive only makes aliases (OSX 10.5.8)

    I'm copying of folders, subfolders and files with picture and video files from a machine (Dual G4) with OSX 10.5.8. They need to be accessible to a windows machine so I've formatted an external hard drive with FAT 32.
    When I drag the folder in question to the external drive I would expect it to copy the folder with folders with subfolders and files intact. However, what I get is the top level folder with the files immediately in that folder copied correctly but the sub-folders are only aliases. When I drag the folder to the external drive it goes through the motions of copying (shows a copy dialogue, takes several minutes to copy the 10Gb of data).
    The files are all under 100mb and no folder with contents is over 1Gb. If I drag and drop the individual files from the subfolder, they copy fine.
    Any ideas? Is there an osx behaviour setting that I'm missing?

    Hi Bob,
    Any illegal MS-Dos characters in Folder names, filenames...
    " * / : < > ? \ [ ] |

  • I backup my iphone on my pc and copy backup file into drive D then i setup new OS on my pc. after that i copy the backup file into itunes backup folder but itunes can't find the backup file to restore my iphone. how can i restore my iphone?

    i backup my iphone on my pc and copy backup file into drive D then i setup new OS on my pc. after that i copy the backup file into itunes backup folder but itunes can't find the backup file to restore my iphone. how can i restore my iphone?

    Don't you just love changes in interfaces?
    I found the answer to my question.
    When you attach a device (iPhone, iPad) to your Mac, in iTunes 12 in appears as a tiny icon in the second "row" of the iTunes display. Click the icon and the familiar iTunes display for the device appears. From there, on the Summary screen, you can see the dates of the backups of the device (iCloud and backup to the computer). You can also use the button to backup to the computer.

  • How to Copy an Image File from a Folder to another Folder

    i face the problem of copying an image file from a folder to another folder by coding. i not really know which method to use so i need some reference about it. hope to get reply soon, thx :)

    Try this code. Make an object of this class and call
    copyTo method.
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class FileUtil
    extends File {
    public FileUtil(String pathname) throws
    NullPointerException {
    super(pathname);
    public void copyTo(File dest) throws Exception {
    File parent = dest.getParentFile();
    parent.mkdirs();
    FileInputStream in = new FileInputStream(this); //
    Open the source file
    FileOutputStream out = new FileOutputStream(dest); //
    Open the destination file
    byte[] buffer = new byte[4096]; // Create an input
    buffer
    int bytes_read;
    while ( (bytes_read = in.read(buffer)) != -1) { //
    Keep reading until the end
    out.write(buffer, 0, bytes_read);
    in.close(); // Close the file
    out.close(); // Close the file
    This is poor object-oriented design. Use derivation only when you have to override methods -- this is just
    a static utility method hiding here.

  • I have files in my iTunes media folder that somehow are not in my library. How do I get iTunes to scan my media folder and add missing files to my library without making a copy of each file in the same location?

    I have files in my iTunes media folder that somehow are not in my library. How do I get iTunes to scan my media folder and add missing files to my library without making a copy of each file in the same location? If I use add file / folder to library, it scans the folder and then makes a copy of any file that is not in my library in the exact same location; I recal in older versions of iTunes being able to just drag my media folder into my library and it would update missing links.

    Only the songs that are connected to iTunes will be copied when you consolidate to a new folder.
    Splitting the media folder away from the usual location makes it harder to move iTunes in the future.
    Are you go move everything back once you've tidied up or are you going to leave it that way? Either way I'd recommend you create an iTunes folder at the new location, an iTunes Media folder inside that, and consolidate to this new iTunes Media folder. You should also use the option File > LIbrary > Organize Library > Rearrange files in the folder "<Media Folder"> if you have not already done so.
    tt2

  • How do I copy printer software files from a folder on my desktop to a CD?

    How do I copy printer software files from a folder on my desktop to a CD?

    Select all the files, right click and choose burn.

  • I can't get download to work - it will not copy the mp3 file to my chosen location (as set in tools/options) - it gives me a new window with a player - no dwnlo

    I am running windows xp sp2 and I have set my dowload location under (tools/options), but when I select an MP3 file to download, firefox does NOT copy the file to my chosen location on my HD - instead, it opens up a new window with a makeshift "player" and begins loading the player with the MP3 file. The problem is that I have no idea where on my system firefox has copied this file to, so, I cannot leave and come back later and play this MP3 file using winamp. I have to listen to it right then or lose it - if I close that new window (with that puny little "player"), then I lose the download, wherever firefox put it on my PC (I got no idea where it is). This is all under firefox 25.0
    I am also running FIrefox 12.0 on an older windows 2000 machine and that works perfectly - I can download any MP3 file I want, and firefox 12.0 (on win2k, sp4) downloads it to my chosen location (on my HD), and it gives me the download window so I can watch its progress and have some control over pause, and resume, and, when it is done, the download window offers me the option to "open containing folder" so I can make sure it got to where I wanted it. In other words, Firefox 12.0 on WIn2k, sp4 works better than firefox 25.0 on winxp sp2!!!!! What gives? I went through and set up my options for XP just like I did with Win2k and it all looks good, but firefox 25.0 just ignores my chosen location and always defaults to give me that makeshift player and I am not able to actually copy the mp3 file to my harddrive - it makes firerox 25.0 almost unusable since downloading mp3 files is a big part of my firexfox use - please help - I am not able to upgrade windows at this time, and, since firefox 12.0 still works fine on win2k, I can't understand what happened at firefox?

    Phillipp,
    I tried it again using "save link as", and this time it actually worked! I just now downloaded several more using the "save link as" option, and it works perfectly. Thanks. Problem solved.
    Littleberry

  • HT2548 how do i copy the domain file from OS 10.4 to a lion OS computer?  I made a copy of the domain file and copied it to my new computer, but it doesn't open in iweb when I double-click on it.

    How do I import an iweb domain file from an ibook (OS 10.4) to an imac (OS 10.73)?
    I copied the domain file from my ibook to my imac, but when I double-click on the file, it doesn't open in iweb. 

    In Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.  Then place the domain file in your Users/Home/Library/Application Support/iWeb folder.
    To open your domain file in Lion or to switch between multiple domain files Cyclosaurus has provided us with the following script that you can make into an Applescript application with Script Editor. Open Script Editor, copy and paste the script below into Script Editor's window and save as an application.
    do shell script "/usr/bin/defaults write com.apple.iWeb iWebDefaultsDocumentPath -boolean no"delay 1
    tell application "iWeb" to activate
    You can download an already compiled version with this link: iWeb Switch Domain.
    Just launch the application, find and select the domain file you want to open and it will open with iWeb. It modifies the iWeb preference file each time it's launched so one can switch between domain files.
    WARNING: iWeb Switch Domain will overwrite an existing Domain.sites2 file if you select to create a new domain in the same folder.  So rename your domain files once they've been created to something other than the default name.
    OT

  • Time Machine only shows the current copy of the file I am trying to restore. There is none of the time machine backup histories shown. I am running OSX 10.7.5. I see the backup files on my external Time Machine hard drive. Help

    Time Machine only shows the current copy of the file I am trying to restore. There is none of the time machine backup histories shown. I am running OSX 10.7.5. I see the backup files on my external Time Machine hard drive in the Backups.backupdb folder.
    Time Machine does show the history of my Macintosh HD, but when I try to navigate to the folder I wish to restore the backup history disappears. I've been searching for answers and I have not found one that works for me.

    Time Machine only shows the current copy of the file I am trying to restore. There is none of the time machine backup histories shown. I am running OSX 10.7.5. I see the backup files on my external Time Machine hard drive in the Backups.backupdb folder.
    Time Machine does show the history of my Macintosh HD, but when I try to navigate to the folder I wish to restore the backup history disappears. I've been searching for answers and I have not found one that works for me.

  • Is a copy of .xml file on the iPod too? If so, how can I copy ONLY the .xml file to my computer and NOT have to copy all my music files too?

    I had to re-load my OS (Windows XP Pro) from a HD snapshot via Acronis True Image Server. I save my OS on my C: drive and all my data files on my D: drive.  So when I re-loaded my OS, I still have all of my music files intact.
    I have re-loaded the OS before and had to re-create iTunes library which I did by doing the follwing:
    1. cut & paste .xml file in iTunes folder to desktop
    2. delete .itl file in iTunes folder
    3. import .xml file through iTunes  file>library>iport playlist
    4. navigate to .xml file on desktop and import
    This worked last time I re-loaded my OS but not this time for some reason.
    So I'm wondering if there is a copy of the .xml file on the iPod itself in the iPod_Control folder that I can copy and paste to my comuter desktop and import via the above steps?
    I have seen all kinds of solutions on the web that include copying the music files from the iPod to the computer.  I don't need to do that.  I have the music files.  I just need the .xml file so iTunes can talk to my iPod (5th Generation - 30G).

    Backup your music library, that is the only way to ensure it does not go missing through theft, damage, operator error, machine breaks, upgrades go wrong, operator goes wrong .........

  • How do I copy my video files from iPhoto to iMovie. The two   hour wait to view all in iMovie puts the kibosh on my edit time.

    How do I copy my video files from iPhoto to iMovie? The two + hour wait for thumb nails and hour long wait looking for the right videos kills the time I have to edit.

    You need to convert the VOB files in the TS-Folder of the DVD back to DV which iMovie is designed to handle. For that you need mpegStreamclip:
    http://www.squared5.com/svideo/mpeg-streamclip-mac.html
    which is free, but you must also have the  Apple mpeg2 plugin :
    http://www.apple.com/quicktime/mpeg2/
    (unless you are running Lion in which case see below))
    which is a mere $20.
    Another possibility is to use DVDxDV:
    http://www.dvdxdv.com/NewFolderLookSite/Products/DVDxDV.overview.htm
    which costs $25.
    For the benefit of others who may read this thread:
    Obviously the foregoing only applies to DVDs you have made yourself, or other home-made DVDs that have been given to you. It will NOT work on copy-protected commercial DVDs, which in any case would be illegal.
    If you are running Lion:
    From the MPEG Streamclip homepage
    The installer of the MPEG-2 Playback Component may refuse to install the component in Lion. Apple states the component is unnecessary in Lion, however MPEG Streamclip still needs it.
    To install the component in Lion, please download MPEG Streamclip 1.9.3b7 beta above; inside the disk image you will find the Utility MPEG2 Component Lion: use it to install the MPEG-2 Playback Component in Lion. The original installer's disk image (QuickTimeMPEG2.dmg) is required.
    The current versions of MPEG Streamclip cannot take advantage of the built-in MPEG-2 functionality of Lion. For MPEG-2 files you still need to install the QuickTime MPEG-2 Playback Component, which is not preinstalled in Lion. You don't have to install QuickTime 7.

  • I can't copy iTunes media files from one external hard drive to another.

    Hi, I am running the latest iTunes and Mavericks software on my MacBook Pro. My iTunes library is stored on an external Seagate 2tb hard drive and it is almost full. I want to transfer the files to a WD Elements 3tb external hard drive and have made that new volume the destination folder for my iTunes library. However, even though I have enabled read/write on both volumes and made the iTunes media folders on both shared folders, I can't copy all the files from the Seagate drive to the WD drive. It comes up with an error message that says "The operation can't be completed because an unexpected error occurred (error code -8058)". I can transfer files from my MacBook hard drive to the new volume, but can't copy files from the old Seagate volume to my MacBook hard drive; it makes the "boing" sound that indicates it is copying but nothing transfers. Files that won't copy include all music files, some video files and all podcast files. Some transferred with no problem. Any ideas out there?

    Hi Limnos, thanks very much for your reply.
    both external drives came preformatted for Windows but I erased each and reformatted them for Mac before using them.
    i made the destination folder on the new WD drive the new iTunes folder using Advanced preferences in iTunes.
    my original iTunes folder on the first drive contained all my iTunes files, as that, also, was the destination folder that was linked via Advanced preferences.
    If I download new content now with the new drive attached, iTunes has no trouble finding where to place the files.
    in Preferences I have both boxes checked (copy files" and "organize") that deal with copying iTunes files.
    When  I first attempted to copy all iTunes files from one media folder to the other on the external drives, I just did a drag and drop of the whole iTunes media folder from one to the other while both were mounted on my desktop. It started copying immediately with no problems, but as it progressed it started skipping files, each time displaying the error message I reported earlier. that included my entire Music folder. When I open, for example, a season folder that contains files that would not copy, eg, Modern Family Season 5, the episodes that won't copy are there and visible but any attempt to drag and drop them into the correct folder on the new drive results in the error message. There is no pattern to it; it will choose some episodes from some seasons but not others, and no music at all.
    when I look at the "missing" files in  iTunes they have the small exclamation mark that indicates the file is missing, but when I locate it through iTunes it doesn't copy the file on the old external drive to the new one. It just plays it having found the file on the old drive.
    originally I had to make the iTunes folder on the old drive into a shared folder using the Get info window after either a software upgrade or an OS upgrade (I can't remember which, it was several years ago). For some reason the upgrade changed the preferences of that folder to a Read Only folder and after researching the problem found the only way to keep using the drive was to make the folder a shared one. I can't remember why and I apologise for that but it was a long time ago.; I can tell you that at the time it was necessary.
    thanks again for your time; I have a good working knowledge of iTunes and Macs in general so I truly believe I have done everything according to how it should be done,, but clearly I've done something wrong!

  • HT1364 help I just completed this task to free up my hard disc and be able to upgrade my iTunes but when I re-opened iTunes it is a blank new account! When I copied the iTunes file to the recycle bin it made me effectively empty as I copied over as it was

    Hey can someone help???
    I just completed this task (support.apple.com/kb/HT1364) moving my music to an external HD to free up my PC hard disc and all went well until I re-opened iTunes and it is a blank new account!
    I also don't can't access anything from the recycle bin as when I copied the iTunes file to the recycle bin it said it was too large to copy over so made me effectively empty as I copied over as it was so big.
    Any help gratefully recieved or where I can get some, I am going round in circles. I also don't know which itunes operating system I have, it is around 3 years old.

    hi i had the same problem today when i updated my itunes to latest version. however, i have just found my songs in the 'itunes media' folder. this was accessed through 'my music'  then keep clicking through until you find itunes media and all my library songs were in there and i then just added these files to my library and all were restored however, i have lost all my playlists but at least my 700 songs are back. very dissapointed with apple that they have let this happen with their latest update, the previous version was miles better than this one . hope you find them. stevo

Maybe you are looking for

  • How to refresh the data in Adobe forms

    Hi, I have created an Adobe form through SFP transaction and a print program which passes data to the form through an internal table. The probelm is, first time the data is getting printed perfectly as per the internal table, but next time when I aga

  • Multiple ESS's in one Portal connected to different backend systems?

    Hi, We have two backend systems installed. We have one portal. We want to create a second copy of the ESS Portal content connected to the the second backend. Datawise this is not a problem. But what about the JCo's and the Homepage Framework? The Web

  • 80 GB freezing

    I really love my new 80 GB iPod but for some reason, it suddenly froze on me and I could dodnothing but let the battery run out. Is there a reason for this and can I do something to stop this from happening? I took a trip across country abd it froze

  • New Files always open up in 2 inch columns

    Whether I am word processing or opening a data base, the new file open up in a two inch column Preferences doesnt allow me to alter this. I have to go to 'page set up,' then to format and adjust the margins for each new file. It has been this way sin

  • Anyway to hide the META-INF folder?

    Is there any way to hide the META-INF folder from the AIR installation archive? More specifically, I'd like to hide the META-INF/AIR/application.xml file. Thanks.