Quantcast
Channel: Active questions tagged windows - Super User
Viewing all articles
Browse latest Browse all 9224

How can I run NET USE if the password starts with a slash?

$
0
0

I'm trying to run the Windows net.exe program to connect to a computer (escaping double quotes on the passwords):

NET USE \\computer /USER:domain\user "%password:"=""%"

But I notice this isn't working for a password starting with a slash ("/"), as it's taken as a keyword:

C:\> NET USE \\computer /USER:domain\user "/password"The option /PASSWORD is unknownThe syntax of this command is:...

Some sites suggest using redirection

echo asdf|net use \\comp /user:dom\user *
net use \\comp /user:dom\user *<password.txt

But these ways aren't working (anymore?), at least on my Windows 10 (version 10.0.19045.4529) machine, with NET nor RUNAS, not even using asdf as password.

So, is there any way I can run NET USE if the password starts with a slash?


Viewing all articles
Browse latest Browse all 9224

Trending Articles