Ref: 11020025
Title: Remote Administration Using Quotes for Multiple-Word Arguments
Date: 11/29/90

Copyright 3Com Corporation, 1991.  All rights reserved.

When you remotely administer a 3+Open network, you may have a problem
if you use a remark that has an embedded space.  For example:

   NET ADMIN \\SERVER /C NET USER USERNAME /ADD /REMARK: "A REMARK"

The result of this command creates a password of REMARK for the user.
Because the administrator did not specifically give a password for
the user, a subsequent login as that user will fail due to a "bad
password," when no password is entered.  The user will not receive an
error message.

The problem is caused by the command's going through CMD.EXE twice, once on
the local machine (NET ADMIN \\SERVER /C) and once on the remote machine
(NET USER USERNAME /ADD /REMARK: "A REMARK"), but the command contains only
one set of quotes.

To solve the problem, type the command using a nested set of quotes and
backslashes:

   NET ADMIN \\SERVER /C NET USER newuser passwd /ADD "/REMARK:\"A REMARK\""

Then, when you issue the NET ADMIN \\SERVER /C part of the command, the first
set of quotes will be stripped off.  (The "/REMARK:\"A REMARK\"" will become
/REMARK:"A REMARK".)  The backslashes will prevent the local CMD.EXE from
interpreting the inside quotes, and the remote CMD.EXE will see them without
the backslashes and use them to keep the remark together.

Also, if you try to create a sharename on a remote server where the sharename
includes a backslash, you will need to use the quotes and backslash to
complete the tasks successfully.  For example, if you typed NET ADMIN
\\SERVER /C "NET SHARE C=C:\" no sharename would be created, and no error
would be given.  (The C:\ is the path of the sharename.)  To create the
sharename you must add an extra \ to tell the secondary command processor
to keep C=C:\ as a path, and enclose it in quotes to keep the multiple-word
command together.  The correct command looks like this:

   NET ADMIN \\SERVER /C "NET SHARE C=C:\\"

For further information, see the 3+Open MS OS/2 LAN Manager Administrator
Reference, pages 3-28 through 3-30.


To issue these same commands without worrying about quotation marks and
backslashes, you can start a remote administrative session on the remote
server before entering any commands.  Execute NET ADMIN \\SERVER /C at
the local workstation.  You will get a prompt that includes the name of
the remote server.  For example:

   net admin \\tennis /c
   [\\tennis]                new system prompt
   net share c=c:\           actual syntax of the command

Now any commands given will run on the server Tennis as if you were sitting
at that server.  To return to your local workstation, type exit and press
Return:

   [\\tennis]
   exit
