NET USE command doesn't authenticate when credentials are passed as parameters

I'm trying to connect to a remote WebDAV server by mapping it as a drive using NET USE command.

NET USE * <domain> /user:<username> <password>

Executing this command gives the following error:

System error 1244 has occurred.

The operation being requested was not performed because the user has not been authenticated.

But when I execute just

NET USE * <domain>

It asks for username and then password.

Enter the user name for <domain>: 
Enter the password for <domain>:

Upon entering this I can now connect to the remote location and the drive is mapped.

What is causing this error? And how can I resolve it?

These commands will be automated, so I would like to pass the credentials as parameters instead of entering when prompted.


Two things: the password should precede the username, and the username should include the users domain name.

NET USE * <link> <password> /USER:<userdomain>\<user>