I am trying to initiate a Endpoint protection scan on a network share. I found that I need to utilize PSEXEC to complete this but it is having problems connecting to the share. I mapped the drive locally and also tried doing a "NET USE" before running the command but doesn't correct the error message that "The system cannot find the path specified" Is there something wrong with my command?

psexec \\servername\share -u username -p password -s cmd /c MpCmdRun -Scan -ScanType 3 -File "N:\TEST"

You're using the command incorrectly. If you review psexec /? you'll see the second statement should be the computer name you want to connect to.

Te user name and password should be used when connecting to the FQDN path of the executable you want to run. I'm also assuming that N:\TEST is the specific file or directory that you're trying to scan. You're specific command should look more like this:

psexec \\remotepc -u username -p password -s cmd /c \\servername\share\MpCmdRun.exe -Scan -ScanType 3 -File "N:\TEST"
  • Thank you, MPCMDRUN.exe does not exist on the remote machine though, I am trying to run the .exe from the local server to scan a remote share.
    – Mlowmn1234
    Mar 29 '16 at 14:51
  • You'll need to either copy the file locally to the remotepc you're trying to scan, or launch the executable MpCmdRun from a shared folder on the network.
    – Nixphoe
    Mar 29 '16 at 14:56
  • Mlowmm1234, I have to agree with Nixphoe on this one. The only alternative I can think of is if your AV scanner has a function built in to scan remote assets, which would negate the need to use psexec in this scenario. I would double check all of your AV scanners settings to ensure there is no remote scanning capability built into your scanner of choice.
    – Sawta
    Mar 29 '16 at 15:08
  • Thank you, I copied the file locally and now I just get "Access Denied" error. I tried running as administrator and as my local account which has rights. Also tried with the -h switch still "Access denied" This share doesn't exist on a server, it is a storage system which doesn't actually have a OS on it.
    – Mlowmn1234
    Mar 29 '16 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.