Calling chkdsk from Powershell

Regular Visitor

I'm building a script that guides an end user through the process of running a basic chkdsk /f on USB drives before sending them back out to the field for our techs to use. I built the script on my computer, I also do not run with Admin rights on the machine, and it works like a charm. However I moved it over to the machine they are going to use for checking and now I'm getting some weird results. USB drive is found but when I select the disk and pass that to the chkdsk command I'm told that it's locked and will need to run elevated. However, I can open powershell or command prompt directly and run chkdsk E: /f and it works no problem. Am I missing something here?


I'll admit I'm not an extremely efficient Powershell guy, but I can usually get the job done but this one I just do not understand.

1 Reply

It's difficult to guess what might be the problem here, possibly the execution policy on the remote computer? 

I would need to see either the error or the script or both, to see what the cause it.