none
Clarification of running Disk Defragmenter remotely using PsExec RRS feed

  • Question

  • Hi there,

    As described in the following link on how to run a disk defragment using Disk Defragmenter via PsExec http://www.winhelponline.com/blog/how-to-run-disk-defragmenter-on-a-remote-computer/, would you say that all parameters mentioned by the author in the blog are applicable? If not, please could you specify which parameters aren't needed in order for me achieve this task efficiently, I've been trying to understand all the parameters for PsExec and from what I can understand I don't think parameters -s and -f are applicable as mentioned in http://technet.microsoft.com/en-gb/sysinternals/bb897553.aspx. Reason why I say this is that when you when specify parameter -s (using system account) in the command and log on as a user of that remote computer in which I've been using Remote Desktop to achieve this as well as Command Prompt, the prompt comes up with "Disk Defragmenter exited with error code 0" straightaway when logging on and logging off as that user on the remote computer, the same also applies when logging off as that user on the remote computer when running the command when being logged on as that user whereas if you don't specify parameter -s the message is delayed for longer which is what I would expect, I'm assuming error code 0 means that the task has completed successfully as mentioned in the following link http://aumha.org/a/defragerr.htm. Another reason as to why I don't think parameter -f is needed is that the program (Disk Defragmenter) will already be on the remote computer and won't require copying it over. Your help would be much appreciated.

    Kind regards,

    RocknRollTim

    P.S. I have been alternating with the command on several computers with Windows XP and Windows 7 using both of my Windows XP and Windows 7 64-bit computers and have proven very interesting in which the command works on computers that don't have SSD drives and have SATA drives and might not require defragmenting as they are optimised, some Windows 7 64-bit computers flag up an issue as well as the odd computer that has Windows XP installed and have tried with both of my computers and keep getting the following message "PsExec could not start c:\windows\system32\defrag.exe on <RemotePC>: No process is on the other end of the pipe.", I suspect it is something to do with Disk Defragmenter not working on this computer as I aware that it is not launching and still trying to find a fix for this i.e. non of the buttons correspond in the GUI, I expect this message when trying to run the command to a remote computer that has Windows XP installed from a computer that has Windows 7 64-bit and a Windows XP computer to a Windows 7 64-bit computer.         

    • Edited by RocknRollTim Saturday, November 15, 2014 12:08 AM
    Saturday, November 15, 2014 12:02 AM

Answers

  • Case closed, managed to solve issue.
    • Marked as answer by RocknRollTim Wednesday, March 29, 2017 11:07 AM
    Wednesday, March 29, 2017 11:07 AM
  • Hi Barry,

    Thank you for bringing this to my attention, I actually use PsExec \\<RemotePC> defrag.exe c: to defrag computers silently, but before I run that command I actually use PsExec -i -s \\<RemotePC> c:\windows\system32\defrag.exe c: /analyse to analyse computer hard drives before defragmentation.

    Regards,

    RocknRollTim

    • Marked as answer by RocknRollTim Wednesday, March 29, 2017 7:48 PM
    Wednesday, March 29, 2017 7:48 PM

All replies

  • Case closed, managed to solve issue.
    • Marked as answer by RocknRollTim Wednesday, March 29, 2017 11:07 AM
    Wednesday, March 29, 2017 11:07 AM
  • It would be nice if you told everyone how you solved the issue so others will not have to rediscover the solution.
    Wednesday, March 29, 2017 6:20 PM
  • Hi Barry,

    Thank you for bringing this to my attention, I actually use PsExec \\<RemotePC> defrag.exe c: to defrag computers silently, but before I run that command I actually use PsExec -i -s \\<RemotePC> c:\windows\system32\defrag.exe c: /analyse to analyse computer hard drives before defragmentation.

    Regards,

    RocknRollTim

    • Marked as answer by RocknRollTim Wednesday, March 29, 2017 7:48 PM
    Wednesday, March 29, 2017 7:48 PM