Net use - error 53 encountered when using c$ but not c$\subfolder

1

When I run this piece of code in Powershell:

net use \\$computerName\c$\ $adminPW /user:$adminUN /Persistent:No

I get:

System error 53 has occurred.
The network path was not found.

However, if I run:

net use \\$computerName\c$\subfolder $adminPW /user:$adminUN /Persistent:No

It executes successfully assuming subfolder exists. Why is this happening? I am running this code in order to eventually create a folder within c$, maybe there is an alternative method?

user1362548

Posted 2018-02-28T18:44:10.743

Reputation: 143

1Try as net use \\$computerName\c$ $adminPW /user:$adminUN /Persistent:No and remove that backslash from the c$\\ if you are trying to map to the root of the hidden "C" share – Pimp Juice IT – 2018-02-28T18:51:10.030

That did it! Thank you! I could have sworn I had tried that but guess not :) – user1362548 – 2018-02-28T18:55:59.550

You could omit the whole c$\\ really, since Windows stores credentials per-host anyway (not per-share). – user1686 – 2018-02-28T19:13:39.033

Answers

0

It seems you have a simple syntax issue when using the net use command to map to the hidden C$ share that you can easily correct by omitting the trailing backslash from the C$ path.

Correct syntax to map to hidden admin shares

net use \\$computerName\c$ $adminPW /user:$adminUN /Persistent:No

Note: You will want to omit the trailing backslash from the \\$computerName\c$\ path and just use \\$computerName\c$ just like that without the final backslash.


Further Resources

Pimp Juice IT

Posted 2018-02-28T18:44:10.743

Reputation: 29 425