Search Results

Search found 13068 results on 523 pages for 'copy paste'.

Page 19/523 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Copy New Files Only in .NET

    - by psheriff
    Recently I had a client that had a need to copy files from one folder to another. However, there was a process that was running that would dump new files into the original folder every minute or so. So, we needed to be able to copy over all the files one time, then also be able to go back a little later and grab just the new files. After looking into the System.IO namespace, none of the classes within here met my needs exactly. Of course I could build it out of the various File and Directory classes, but then I remembered back to my old DOS days (yes, I am that old!). The XCopy command in DOS (or the command prompt for you pure Windows people) is very powerful. One of the options you can pass to this command is to grab only newer files when copying from one folder to another. So instead of writing a ton of code I decided to simply call the XCopy command using the Process class in .NET. The command I needed to run at the command prompt looked like this: XCopy C:\Original\*.* D:\Backup\*.* /q /d /y What this command does is to copy all files from the Original folder on the C drive to the Backup folder on the D drive. The /q option says to do it quitely without repeating all the file names as it copies them. The /d option says to get any newer files it finds in the Original folder that are not in the Backup folder, or any files that have a newer date/time stamp. The /y option will automatically overwrite any existing files without prompting the user to press the "Y" key to overwrite the file. To translate this into code that we can call from our .NET programs, you can write the CopyFiles method presented below. C# using System.Diagnostics public void CopyFiles(string source, string destination){  ProcessStartInfo si = new ProcessStartInfo();  string args = @"{0}\*.* {1}\*.* /q /d /y";   args = string.Format(args, source, destination);   si.FileName = "xcopy";  si.Arguments = args;  Process.Start(si);} VB.NET Imports System.Diagnostics Public Sub CopyFiles(source As String, destination As String)  Dim si As New ProcessStartInfo()  Dim args As String = "{0}\*.* {1}\*.* /q /d /y"   args = String.Format(args, source, destination)   si.FileName = "xcopy"  si.Arguments = args  Process.Start(si)End Sub The CopyFiles method first creates a ProcessStartInfo object. This object is where you fill in name of the command you wish to run and also the arguments that you wish to pass to the command. I created a string with the arguments then filled in the source and destination folders using the string.Format() method. Finally you call the Start method of the Process class passing in the ProcessStartInfo object. That's all there is to calling any command in the operating system. Very simple, and much less code than it would have taken had I coded it using the various File and Directory classes. Good Luck with your Coding,Paul Sheriff ** SPECIAL OFFER FOR MY BLOG READERS **Visit http://www.pdsa.com/Event/Blog for a free video on Silverlight entitled Silverlight XAML for the Complete Novice - Part 1.  

    Read the article

  • Copy Thunderbird accounts and preferences from Linux to Mac/Windows

    - by Josh
    This is similar to this question but not exactly a duplicate. My Linux laptop has recently been hanging for no apparent reason, and so I have been using a Mac OS X laptop in the meantime. I just installed Thunderbird and wanted to copy all my preferences and account settings to the new laptop. All email accounts are IMAP based. Can I simply copy the data, or does Thunderbird for OS X store data in a different format from OS X? What about if I wanted to copy the preferences to Thunderbird under Windows? Finally, what files do I copy? I haven't powered up the Linux laptop yet but I'm guessing there's a ~/.thunderbird/ directory, can I just copy this to the Mac?

    Read the article

  • Windows won't ctrl+c and ctrl+v

    - by Thomasstuck
    Using Ctrl+C and V I am unable to copy or paste anything. I have tried many different applications and still no luck. I am able to copy/paste via the shortcut menu when you right click the mouse. Ctrl+F works which means the Ctrl button is functional. I've tried restoring to an earlier restore point. I also ran SFC /SCANNOW (System File Checker) which did not find any errors. Ctrl+C and then right click and paste doesn't work either. I have tried with external and internal keyboard and still no luck. I've clicked on all the relevant search results from Google but none of them work for me. Does anyone know what may be causing this issue and how I can correct it? This problem comes and goes at random times.

    Read the article

  • Tool that automatically keeps old versions of a file? Shadow Copy in Win7?

    - by Michael Stum
    When I'm working with a Graphics App, I press CTRL+S a lot to Quicksave. Sometimes, I just went too far and made a bad decision, sometimes to the point Undo wouldn't help either. I would love to retain old versions of a file. Normally, Source Control would be of use here, but that's a manual process (same as just making some copies). I wonder if there is an automatic way to do that? Everytime the file changes, keep a backup. I believe that in Windows Server, Shadow Copies can do that. When I check in my Windows 7 (Ultimate), I do see "Previous Versions" as a tab, but that seems to be part of the backup function which is once again manual. Is there a way to get that type of automatic versioning?

    Read the article

  • Pasting into Vista cmd.exe broke, why?

    - by Michel de Ruiter
    I use Windows Vista x64 and regularly use the command line window CMD.EXE. I have enabled QuickEdit Mode (and Insert Mode and AutoComplete), to be able to quickly copy and paste text. Copying (select block, Enter) works fine. Pasting (right click) text also works, as long as it has been copied inside a CMD.EXE window. When I copied the text somewhere else (in an editor, browser or whatever) however, pasting into CMD.EXE does not work! :-( Using the menu to Edit, Paste does not do anything either, so it's not a mouse thing. I also tried elevating CMD.EXE. I can copy/paste freely between CMD.EXE instances of all sorts: elevated/normal, x64/x86... I'm sure it did work on this machine until relatively recently. What could have happened? Some Windows Update perhaps? The problem has been reported by others, but without a solution.

    Read the article

  • Word to GIMP pasted image too small

    - by Marcelo Cantos
    I paste an image from Microsoft Word 2010 into GIMP 2.6.10 using Edit ? Paste as ? New Image, but the pasted image is less than half-size (1280×800 down to 553×347). Pasting into an existing blank 1280×800 image makes no difference. On the other hand, pasting exactly the same clipboard entry into Windows Paint works beautifully, producing a razor-sharp 1280×800 image, and furthermore, pressing Ctrl+C in Paint, then going to Gimp and pressing Shift+Ctrl+V in Gimp produces the correct full-size image in Gimp too. Why does pasting an image directly from Word to Gimp reduce the image size? How can I make it paste the correct image size without having to go via Paint? UPDATE: I just noticed that cutting the image from Word and pasting back into the same document also loses definition. Paint must be magical.

    Read the article

  • Is there any way a user can view or copy GUI controls' properties at runtime?

    - by jqngrc
    Here are two examples of what I mean: I am sure you all too have experienced this frustration before. A dialog box opens that displays only part of a long string (e.g. a file path), but won't allow you to select the text so you can see the full string. Neither it will resize upon window resizing—which is unusual among Windows dialog boxes. The text is hidden, period. Copying a very long drop-down list control contents to a text file. Do you know any way to solve these problems?

    Read the article

  • Copy Excel Formatting the Easy Way with Format Painter

    - by DigitalGeekery
    The Format Painter in Excel makes it easy to copy the formatting of a cell and apply it to another. With just a few clicks you can reproduce formatting such as fonts, alignment, text size, border, and background color. On any Excel worksheet, click on the cell with the formatting you’d like to copy.  You will see dashed lines around the selected cell. Then select the Home tab and click on the Format Painter.   You’ll see your cursor now includes a paintbrush graphic. Move to the cell where you’d like to apply the formatting and click on it. Your target cell will now have the new formatting.   If you double-clicking on Format Painter you can then click on multiple individual files to which to apply the format. Or, you can click and drag across a group of cells. When you are finished applying formats, click on Format Painter again, or on the Esc key, to turn it off. The Format Painter is a very simple, but extremely useful and time saving tool when creating complex worksheets. Similar Articles Productive Geek Tips Use Conditional Formatting to Find Duplicate Data in Excel 2007Remove Text Formatting in Firefox the Easy WayMake Excel 2007 Always Save in Excel 2003 FormatUsing Conditional Cell Formatting in Excel 2007Make Word 2007 Always Save in Word 2003 Format TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 New Firefox release 3.6.3 fixes 1 Critical bug Dark Side of the Moon (8-bit) Norwegian Life If Web Browsers Were Modes of Transportation Google Translate (for animals) Roadkill’s Scan Port scans for open ports

    Read the article

  • Win a Free Copy of Windows Presentation Foundation 4.5 Cookbook

    - by Ricardo Peres
    Win A free copy of the 'Windows Presentation Foundation 4.5 Cookbook', just by commenting! For the contest, Packt Publishing has two eBook copies of Windows Presentation Foundation 4.5 Cookbookto be given away to two lucky winners. How you can win: To win your copy of this book, all you need to do is come up with a comment below highlighting the reason "why you would like to win this book”. Duration of the contest & selection of winners: The contest is valid for 7 days (until November 26), and is open to everyone. Winners will be selected on the basis of their comment posted. Windows Presentation Foundation 4.5 Cookbookis written by Pavel Yosifovich, the CTO of CodeValue (http://www.codevalue.net), a software development, consulting, and training company, based in Israel. This book is written in an easy-to-read style, with a strong emphasis on real-world, practical examples. Step-by-step explanations are provided for performing important tasks. This book is the best guide for C# developer who is looking forward to increase understanding and knowledge of WPF. Using this book, readers will learn to build complex and flexible user interfaces using XAML, perform lengthy operations asynchronously while keeping the UI responsive, get well-versed with WPF features such as data binding, layout, resources, templates, and styles and also customize a control’s template to alter appearance but preserve behavior. In the next days I will post my review on this book. In the meantime, here’s the table of contents: Preface Chapter 1: Foundations Chapter 2: Resources Chapter 3: Layout and Panels Chapter 4: Using Standard Controls Chapter 5: Application and Windows Chapter 6: Data Binding Chapter 7: Commands and MVVM Chapter 8: Styles, Triggers, and Control Templates Chapter 9: Graphics and Animation Chapter 10: Custom Elements Chapter 11: Threading Index I’m waiting for your comments!

    Read the article

  • How to create a copy of an instance without having access to private variables

    - by Jamie
    Im having a bit of a problem. Let me show you the code first: public class Direction { private CircularList xSpeed, zSpeed; private int[] dirSquare = {-1, 0, 1, 0}; public Direction(int xSpeed, int zSpeed){ this.xSpeed = new CircularList(dirSquare, xSpeed); this.zSpeed = new CircularList(dirSquare, zSpeed); } public Direction(Point dirs){ this(dirs.x, dirs.y); } public void shiftLeft(){ xSpeed.shiftLeft(); zSpeed.shiftRight(); } public void shiftRight(){ xSpeed.shiftRight(); zSpeed.shiftLeft(); } public int getXSpeed(){ return this.xSpeed.currentValue(); } public int getZSpeed(){ return this.zSpeed.currentValue(); } } Now lets say i have an instance of Direction: Direction dir = new Direction(0, 0); As you can see in the code of Direction, the arguments fed to the constructor, are passed directly to some other class. One cannot be sure if they stay the same because methods shiftRight() and shiftLeft could have been called, which changes thos numbers. My question is, how do i create a completely new instance of Direction, that is basically copy(not by reference) of dir? The only way i see it, is to create public methods in both CircularList(i can post the code of this class, but its not relevant) and Direction that return the variables needed to create a copy of the instance, but this solution seems really dirty since those numbers are not supposed to be touched after beeing fed to the constructor, and therefore they are private.

    Read the article

  • Copy Ubuntu distro with all settings from one computer to a different one

    - by theFisher86
    I'd like to copy my exact setup from my computer at work to my computer at home. I'm trying to figure out how to go about doing that. So far I've figured this much out. On the source computer run dpkg --get-selections > installed-software and backup the installed-software file Backup /etc/apt/sources.list Backup /usr/share/applications/ to save all my custom Quicklists Backup /etc/fstab to save all my network mounts Backup /usr/share/themes/ to save the customization I've done to my themes I'm also going to backup my entire HOME directory. Once I get to the destination computer I'm going to first do just a fresh install of 11.10 Then I'll copy over my HOME directory, /etc/apt/sources.list, /usr/share/appications, /etc/fstab and /usr/share/themes/ Then I'm going to run dpkg --set-selections < installed-software Followed by dselect That should install all of my apps for me. I'm wondering if there's a way/need to backup dconf and gconf settings from the source computer? I guess that's my ultimate question. I'd also like any notes on anything else that might need backed up as well before I undertake this project. I hope this post is legit, I figured other people would be interested in knowing this process and I don't see any other questions that seem to really document this on here. I'd also like to further this project and have each computer routinely backup all the necessary files so that both computer are basically identical at all times. That's stage 2 though...

    Read the article

  • Unzipping in Java and FileUtil.copy

    - by Geertjan
    Via NetBeans File Systems API, which provides FileUtil.copy below, which means a dependency on NetBeans Utilities API: private void unzipEpubFile(String folder, File file) throws IOException { final AtomicBoolean canceled = new AtomicBoolean(); //define and start progress bar here... // ProgressHandle handle = // ProgressHandleFactory.createHandle( // Bundle.MSG_unpacking(zip.getName()), // new Cancellable() { // @Override // public boolean cancel() { // return canceled.compareAndSet(false, true); // } // }); //then unzip 'file' into 'root": try { List folders = new ArrayList<>(); try (InputStream is = new FileInputStream(file)) { ZipInputStream zis = new ZipInputStream(is); ZipEntry entry; while ((entry = zis.getNextEntry()) != null) { if (canceled.get()) { return; } String n = entry.getName(); File f = new File(folder, n); if (n.endsWith("/")) { if (!f.isDirectory()) { if (!f.mkdirs()) { throw new IOException("could not make " + f); } if (entry.getTime() > 0) { if (!f.setLastModified(entry.getTime())) { // oh well } } } folders.add(f); } else { //handle.progress(Bundle.MSG_creating(n)); File p = f.getParentFile(); if (!p.isDirectory() && !p.mkdirs()) { throw new IOException("could not make " + p); } try (OutputStream os = new FileOutputStream(f)) { FileUtil.copy(zis, os); } if (entry.getTime() > 0) { if (!f.setLastModified(entry.getTime())) { // oh well } } } } } //handle.switchToDeterminate(folders.size()); if (canceled.get()) { } } finally { //stop progress bar } } Mostly from NetBeans IDE sources for working with projects and ZIP files.

    Read the article

  • Efficient way to copy a collection of Nodes, treat them, and then serialize?

    - by Danjah
    Hi all, I initially thought a regex to remove YUI3 classNames (or whole class attributes) and id attributes from a serialized DOM string was a sound enough approach - but now I'm not sure, given various warnings about using regex on HTML. I'm toying with the idea of making a copy of the DOM structure in question, performing: var nodeStructure = Y.one('#wrap').all('*'); // A YUI3 NodeList // Remove unwanted classNames.. I'd need to maintain a list of them to remove :/ nodeStructure.removeClass('unwantedClassName'); and then: // I believe this can be done on a NodeList collection... nodeStructure.removeAttribute('id'); I'm not quite sure about what I'd need to do to 'copy' a collection of Nodes anyway, as I don't actually want to do the above to my living markup, as its only being saved - not 'closed' or 'exited', a user could continue to change the markup, and then save again. The above doesn't make a copy, I know. Is this efficient? Is there a better way to 'sanitize' my live markup of framework additions to the DOM (and maybe other things too at a later point), before saving it as a string? If it is a good approach, what's a safe way to go about copying my collection of Nodes for safe cleaning? Thanks! d

    Read the article

  • How do I copy files into an existing JAR file with Ant?

    - by Blue
    I have a project that needs to access resources within its own JAR file. When I create the JAR file for the project, I would like to copy a directory into that JAR file (I guess the ZIP equivalent would be "adding" the directory to the existing ZIP file). I only want the copy to happen after the JAR has been created (and I obviously don't want the copy to happen if I clean and delete the JAR file). Currently the build file looks like this: <?xml version="1.0" encoding="UTF-8"?> <project name="foobar" basedir=".." default="jar"> <!-- project-specific properties --> <property name="project.path" value="my/project/dir/foobar" /> <patternset id="project.include"> <include name="${project.path}/**" /> </patternset> <patternset id="project.jar.include"> <include name="${project.path}/**" /> </patternset> <import file="common-tasks.xml" /> <property name="jar.file" location="${test.dir}/foobar.jar" /> <property name="manifest.file" location="misc/foobar.manifest" /> </project> Some of the build tasks are called from another file (common-tasks.xml), which I can't display here. Thanks.

    Read the article

  • How to check successful copy() function execution in php?

    - by OM The Eternity
    How to check successful copy() function execution in php? I am using the following code: <? function full_copy( $source, $target ) { if ( is_dir( $source ) ) { @mkdir( $target ); $d = dir( $source ); while ( FALSE !== ( $entry = $d->read() ) ) { if ( $entry == '.' || $entry == '..' ) { continue; } $Entry = $source . '/' . $entry; if ( is_dir( $Entry ) ) { full_copy( $Entry, $target . '/' . $entry ); continue; } copy( $Entry, $target . '/' . $entry ); } $d->close(); }else { copy( $source, $target ); } } $source ='.'; $destination = '/html/parth/'; full_copy($source, $destination); ?> I do not get anything in my parth folder. Why? I am using Windows, Script is executed on fedora system (its my server)...

    Read the article

  • Can not copy files from NTFS partition

    - by Ali
    I am experiencing a weird problem. I was running Xubuntu on my laptop until yesterday that I had to delete Xubuntu and install Windows. I had a NTFS partition on my Xubuntu that I kept some files on it. Today after installing windows I wanted to move all the files from that partition to an external HDD. I selected all files and folders and clicked on Copy, then I went to the HDD and clicked on paste but nothing happened. I can not do that. I do not know why. I copy the files, and wherever I click paste, nothing happens. If I try to copy the files and folders one by one, I can copy some of them, but some of them do not move. The other problem I have is that I can not open some files, in particular pdf files. When I click on pdf files I get this error: There was an error opening this document. This file cannot be found. Also, I cannot play some mp4 files. I can not open some jpg and txt files. I get this error The directory name is invalid. So in summary, after removing Xubuntu and installing windows 7 I have the following problems with one of the NTFS partitions on my internal drive: Can not copy or cut all folders and files from that partition to any other partition - I also do not get any errors. Can copy some folders and files Can not access some pdf, jpeg, txt and mp4 files and get the above errors. I should also mention I did not change anything for this partition during the installation or formatting the other partitions.

    Read the article

  • Can not copy files after installing windows

    - by Ali
    I am experiencing a weird problem. I was running Xubuntu on my laptop until yesterday that I had to delete Xubuntu and install Windows. I had a NTFS partition on my Xubuntu that I kept some files on it. Today after installing windows I wanted to move all the files from that partition to an external HDD. I selected all files and folders and clicked on Copy, then I went to the HDD and clicked on paste but nothing happened. I can not do that. I do not know why. I copy the files, and wherever I click paste, nothing happens. If I try to copy the files and folders one by one, I can copy some of them, but some of them do not move. The other problem I have is that I can not open some files, in particular pdf files. When I click on pdf files I get this error: There was an error opening this document. This file cannot be found. Also, I cannot play some mp4 files. I can not open some jpg and txt files. I get this error The directory name is invalid. So in summary, after removing Xubuntu and installing windows 7 I have the following problems with one of the NTFS partitions on my internal drive: Can not copy or cut all folders and files from that partition to any other partition - I also do not get any errors. Can copy some folders and files Can not access some pdf, jpeg, txt and mp4 files and get the above errors. I should also mention I did not change anything for this partition during the installation or formatting the other partitions.

    Read the article

  • unable to copy file to folder, permission denied without explanation

    - by ValekHalfHeart
    Recently Norton Internet security deleted ml.exe (an assembler I use to program in masm32) off of my computer, thinking that one of the programs I had written with it was a virus (it was most certainly not). Fortunately, I had a copy of ml.exe backed up in an external hard drive, and tried to copy it over to my computer. The old ml.exe was located in C:\masm32\bin, so I tried to copy the new one to that location. After disabling Norton (which had opened the folder and preventing me from accessing it), I am still unable to copy the new file to C:\masm32\bin. When I tried, Windows announced that I would need Administrator permission to copy the file. Since I'm an admin, I figured this wouldn't be a problem although it was unexpected, as I have never had to provide administrator permission to access this folder before. However, instead of prompting me to enter my password, Windows simply refuses to copy the file: I repeat, I was not asked to provide a password. It simply says that I do not have permission. Does anyone know what's happening and how to fix it? Is Norton still causing problems, or it something else?

    Read the article

  • Copy past speed very slow for a large number of files on Windows [closed]

    - by Arno2501
    I've run the following test I've created a folder containing 15'000 files of 400 bytes using this batch : @ECHO off SET times=15000 FOR /L %%i IN (1,1,%times%) DO ( fsutil file createnew filename%%i.txt 400 ) then I copy past it on my Windows Computer using this command : robocopy LargeNumberOfFiles\ LargeNumberOfFiles2\ After it has completed I can see that the transfer rate was 915810 Bytes/sec this is less than 1 MB/s. It took me several seconds to copy 7 MBytes Please note that this is very slow. I've tried the same with a folder with a single file of 50 Mbytes and the transfer rate is 1219512195 Bytes/sec. (yeah GB/s) instantaneous. Why copying large number of files take so much time - ressources on a windows filesystem ? Please note that I've tried to do the same on a linux system which runs on the same computer in a virtual machine (vmware player) with ext3 filesystem. I use the cp command and the copy is instantaneous ! Please also note the following : no antivirus I've tested that behaviour on multiple windows computers (always ntfs) i always get comparable results (transfer rate under 1MB/s avg 7-8 seconds to copy 7 MBytes) I've tested on multiple linux ext3 system the copy is always instantaneous for that amount (15000 files of 400 bytes) The question is about understanding what makes windows filesystem so slow to copy large number of files compared to a linux one for instance.

    Read the article

  • How to exclude copy local referenced assemblies from a VSIX

    - by Daniel Cazzulino
    When you add library references to project that are not reference assemblies or installed in the GAC, Visual Studio defaults to setting Copy Local to True: If, however, those dependencies are distributed by some other means (i.e. another extension, or are part of VS private assemblies, or whatever) and you want to avoid including them in your VSIX, you can add the following property to the project file: &lt;PropertyGroup&gt; ... &lt;IncludeCopyLocalReferencesInVSIXContainer&gt;false&lt;/IncludeCopyLocalReferencesInVSIXContainer&gt;Read full article

    Read the article

  • Simplifying C++11 optimal parameter passing when a copy is needed

    - by Mr.C64
    It seems to me that in C++11 lots of attention was made to simplify returning values from functions and methods, i.e.: with move semantics it's possible to simply return heavy-to-copy but cheap-to-move values (while in C++98/03 the general guideline was to use output parameters via non-const references or pointers), e.g.: // C++11 style vector<string> MakeAVeryBigStringList(); // C++98/03 style void MakeAVeryBigStringList(vector<string>& result); On the other side, it seems to me that more work should be done on input parameter passing, in particular when a copy of an input parameter is needed, e.g. in constructors and setters. My understanding is that the best technique in this case is to use templates and std::forward<>, e.g. (following the pattern of this answer on C++11 optimal parameter passing): class Person { std::string m_name; public: template <class T, class = typename std::enable_if < std::is_constructible<std::string, T>::value >::type> explicit Person(T&& name) : m_name(std::forward<T>(name)) { } ... }; A similar code could be written for setters. Frankly, this code seems boilerplate and complex, and doesn't scale up well when there are more parameters (e.g. if a surname attribute is added to the above class). Would it be possible to add a new feature to C++11 to simplify code like this (just like lambdas simplify C++98/03 code with functors in several cases)? I was thinking of a syntax with some special character, like @ (since introducing a &&& in addition to && would be too much typing :) e.g.: class Person { std::string m_name; public: /* Simplified syntax to produce boilerplate code like this: template <class T, class = typename std::enable_if < std::is_constructible<std::string, T>::value >::type> */ explicit Person(std::string@ name) : m_name(name) // implicit std::forward as well { } ... }; This would be very convenient also for more complex cases involving more parameters, e.g. Person(std::string@ name, std::string@ surname) : m_name(name), m_surname(surname) { } Would it be possible to add a simplified convenient syntax like this in C++? What would be the downsides of such a syntax?

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >