none
PSexec -c option : where is the file copied to (and does it stay there) RRS feed

  • Question

  • Hi All,

    Can you share some details as to how does PSexec64 -c works? Where is the file copied to on the target host? And does it stay there or removed after it is executed? The -v option seems to imply that the file is not removed, but when I tried searching for it after the execution I couldn't find it. 

    So can someone please clarify that?

    Many thanks,

    Oren



    • Edited by orenshani7 Tuesday, November 12, 2019 6:55 AM
    Tuesday, November 12, 2019 6:55 AM

All replies

  • From the "bible", Troubleshooting with the Windows SysInternals tools:

    HTH
    -mario

    • Proposed as answer by mariora_ Tuesday, November 12, 2019 8:17 AM
    Tuesday, November 12, 2019 8:17 AM
  • mario,

    So just to clarify, PsExec always removes the file after execution ends, however, if another instance of PsExec will try to copy the same file while it is still in use, then the file will not be copied and the same existing copy will be used. 

    Is that correct?

    Thanks,

    Oren


    Tuesday, November 12, 2019 2:18 PM
  • This really depends on if you specify other options. By example -f will force the file copy even if the file is already present.

    So, if you don't specify any additional parameter, when psexec terminates it will delete the file. if you run multiple instances of psexec, and the second one starts when the first one has not yet finished, it won't copy another file (unless you use -f) and will use the one already available as you stated.

    Just to avoid conflict i generally include psexec ina cmd where if needed I copy the required files in a folder in the destination machine and then execute the program from that folder leaving the file behind for another time..

    HTH
    -mario

    Tuesday, November 12, 2019 3:54 PM