Can a file copy be detected on windows?











up vote
-1
down vote

favorite












I want to trigger a piece of code to run as soon as a 'copy' command is executed on Windows. Let's say I want to perform some operations as soon as the user tries to copy a file. Is there any way to detect the 'copy' operation on Windows?










share|improve this question






















  • Copying is not an atomic operation that can be identified and monitored at the file-system level. It's simply reading the file data and some or all metadata.
    – eryksun
    2 days ago










  • Yes, this is possible. That's what anti-malware software does. What is your question?
    – IInspectable
    2 days ago















up vote
-1
down vote

favorite












I want to trigger a piece of code to run as soon as a 'copy' command is executed on Windows. Let's say I want to perform some operations as soon as the user tries to copy a file. Is there any way to detect the 'copy' operation on Windows?










share|improve this question






















  • Copying is not an atomic operation that can be identified and monitored at the file-system level. It's simply reading the file data and some or all metadata.
    – eryksun
    2 days ago










  • Yes, this is possible. That's what anti-malware software does. What is your question?
    – IInspectable
    2 days ago













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I want to trigger a piece of code to run as soon as a 'copy' command is executed on Windows. Let's say I want to perform some operations as soon as the user tries to copy a file. Is there any way to detect the 'copy' operation on Windows?










share|improve this question













I want to trigger a piece of code to run as soon as a 'copy' command is executed on Windows. Let's say I want to perform some operations as soon as the user tries to copy a file. Is there any way to detect the 'copy' operation on Windows?







windows operating-system copy






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 2 days ago









V.I.L

43




43












  • Copying is not an atomic operation that can be identified and monitored at the file-system level. It's simply reading the file data and some or all metadata.
    – eryksun
    2 days ago










  • Yes, this is possible. That's what anti-malware software does. What is your question?
    – IInspectable
    2 days ago


















  • Copying is not an atomic operation that can be identified and monitored at the file-system level. It's simply reading the file data and some or all metadata.
    – eryksun
    2 days ago










  • Yes, this is possible. That's what anti-malware software does. What is your question?
    – IInspectable
    2 days ago
















Copying is not an atomic operation that can be identified and monitored at the file-system level. It's simply reading the file data and some or all metadata.
– eryksun
2 days ago




Copying is not an atomic operation that can be identified and monitored at the file-system level. It's simply reading the file data and some or all metadata.
– eryksun
2 days ago












Yes, this is possible. That's what anti-malware software does. What is your question?
– IInspectable
2 days ago




Yes, this is possible. That's what anti-malware software does. What is your question?
– IInspectable
2 days ago












1 Answer
1






active

oldest

votes

















up vote
0
down vote













You may monitor the clipboard (see Creating a Clipboard Format Listener) and check if there is an object with format CF_HDROP in it. But it will not tell you when the clipboard paste operation actually started.



This also will not cover copying which does not involve clipboard, like direct file_read/file_write loop in a File Manager application. For this you may monitor changes in the file system (see How can I monitor a Windows directory for changes?) but it will not tell you where was the file copied from, just where was it pasted to.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203843%2fcan-a-file-copy-be-detected-on-windows%23new-answer', 'question_page');
    }
    );

    Post as a guest
































    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    You may monitor the clipboard (see Creating a Clipboard Format Listener) and check if there is an object with format CF_HDROP in it. But it will not tell you when the clipboard paste operation actually started.



    This also will not cover copying which does not involve clipboard, like direct file_read/file_write loop in a File Manager application. For this you may monitor changes in the file system (see How can I monitor a Windows directory for changes?) but it will not tell you where was the file copied from, just where was it pasted to.






    share|improve this answer

























      up vote
      0
      down vote













      You may monitor the clipboard (see Creating a Clipboard Format Listener) and check if there is an object with format CF_HDROP in it. But it will not tell you when the clipboard paste operation actually started.



      This also will not cover copying which does not involve clipboard, like direct file_read/file_write loop in a File Manager application. For this you may monitor changes in the file system (see How can I monitor a Windows directory for changes?) but it will not tell you where was the file copied from, just where was it pasted to.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        You may monitor the clipboard (see Creating a Clipboard Format Listener) and check if there is an object with format CF_HDROP in it. But it will not tell you when the clipboard paste operation actually started.



        This also will not cover copying which does not involve clipboard, like direct file_read/file_write loop in a File Manager application. For this you may monitor changes in the file system (see How can I monitor a Windows directory for changes?) but it will not tell you where was the file copied from, just where was it pasted to.






        share|improve this answer












        You may monitor the clipboard (see Creating a Clipboard Format Listener) and check if there is an object with format CF_HDROP in it. But it will not tell you when the clipboard paste operation actually started.



        This also will not cover copying which does not involve clipboard, like direct file_read/file_write loop in a File Manager application. For this you may monitor changes in the file system (see How can I monitor a Windows directory for changes?) but it will not tell you where was the file copied from, just where was it pasted to.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 2 days ago









        xmojmr

        7,00842239




        7,00842239






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203843%2fcan-a-file-copy-be-detected-on-windows%23new-answer', 'question_page');
            }
            );

            Post as a guest




















































































            Popular posts from this blog

            Schultheiß

            Verwaltungsgliederung Dänemarks

            Liste der Kulturdenkmale in Wilsdruff