Page 1 of 1

Administrative Share after device plugging

Posted: Feb 5th, 2012, 2:17 am
by ProCompSys
I used to net-share devices as administrative share after plugging using this command-line:

Code: Select all

net share %DriveLetter%$=%DriveLetter%:
Since I don't use or check its functionality too often, I only now found out, it doesn't work anymore.
Examining the commandline I found that p.ex.

Code: Select all

net share L:$=L::
obviously makes no sense.
But as it has worked before, I guess there must have been a change in the variable %DriveLetter%.
I guess it used to be the Drive-Letter without the colon at the time I wrote the line, making it

Code: Select all

net share L$=L:
which works like a charm.

Now I don't see any other solution as to call an external batch-script, which removes the colon from the variable and net-share it from there.

Can you confirm you changed the variable-content to the additional colon?
Is there another variable at hand that contains only the Drive-Letter without the colon, so I can use a single commandline in the input-field without calling an external batch-script?

Greetings from Germany!