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 unknown

The 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?

8
  • /Password is not nor has it ever been an argument for that executable. what you are trying to do with that executable isn’t supported. Suspect your confusing that executable with a different tool.
    – Ramhound
    Commented Jun 20 at 22:58
  • Your probably thinking of psexec
    – Ramhound
    Commented Jun 20 at 23:04
  • "/password" is the actual password starting with a slash. Commented Jun 20 at 23:22
  • Read the documentation for the tool. It does not support what your attempting to do. psexec supports what your attempting to do. “This command is only used on local computer.”
    – Ramhound
    Commented Jun 20 at 23:26
  • 1
    I don't get you. NET USE \\computer /user:dom\user "password1234" is correct, it works, except when the password starts with a slash. Commented Jun 20 at 23:43

0

You must log in to answer this question.

Browse other questions tagged .