Page 1 of 1 1
Topic Options
#122159 - 2004-07-04 02:28 PM How to map using USERID to hidden share
BartS Offline
Fresh Scripter

Registered: 2004-07-04
Posts: 5
Hello,

For each user on our network I have a userfolder which
has the same name as the login name. These userfolders
are shared with the $ sign behind the share name to make
it hidden. But now I try to map this share to a drive
name using kix

use g: "\\ntserver02\users\@USERID$"

But this does not work

Using Win2k3 server, NT4 workstation, XP prof.

Anyone can help me out ?

Thanks

BartS
_________________________
Pls change my email AT will become @ and X should be dots

Top
#122160 - 2004-07-04 03:01 PM Re: How to map using USERID to hidden share
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
This is not a KIX issue, but a MCSE question


Quote:

These userfolders
are shared with the $ sign behind the share name to make
it hidden




this is incorrect use g: "\\ntserver02\users\@USERID$"


this is correct use g: "\\ntserver02\"+@USERID+"$$"
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#122161 - 2004-07-04 03:53 PM Re: How to map using USERID to hidden share
BartS Offline
Fresh Scripter

Registered: 2004-07-04
Posts: 5
Hi Radimus,

Thanks for your reply. I will try this. I use the
code 'use g:.....' in a very simple kix login script
but I am not aware that it is actually not kix but MCSE (?)
question.

If you have alternative for kix, please let me know.

FYI, if I map to hidden share, it works. Only the use
of the @USERID macro with a hidden share giving me
problems when I use the 'use' command

Cheers

BartS
_________________________
Pls change my email AT will become @ and X should be dots

Top
#122162 - 2004-07-04 04:14 PM Re: How to map using USERID to hidden share
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
It is both a KiX and MCSE question.

Why do you have "USERS" sharename in the path? You cannot have two sharenames in the path!

MCSE rule:
NET USE [drive] \\server\share

Kix rule on USE is the same.

KiX rule (borrowing from the manual):
Quote:

Note: The characters @, %, or $ are normally used to indicate macros, environment strings, or variables. If you want to use these characters in a string, use @@, %%, or $$.




So, to summarize... your code is wrong, Rad's example is right.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#122163 - 2004-07-04 04:23 PM Re: How to map using USERID to hidden share
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
MCSE

Must Call Someone Else

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#122164 - 2004-07-04 04:30 PM Re: How to map using USERID to hidden share
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
MCSE = Choose from the following

Edited by Les (2004-07-04 04:49 PM)
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#122165 - 2004-07-04 05:00 PM Re: How to map using USERID to hidden share
BartS Offline
Fresh Scripter

Registered: 2004-07-04
Posts: 5
Hi Les, Radimus

I am ....

First I was thinking...what they talk about
'You cannot have two sharenames in the path!'

Novell .... and mind you.... sysop is not my job,
that's why I post in the starters group.

Abt the MSCE... or MCSE which one you are joking
me now... MS Certified E, or Microsoft Cert Syst Eng.

Anyway... I have changed my error line and now it works

MANY THANKS !!!

cheers

BartS
_________________________
Pls change my email AT will become @ and X should be dots

Top
#122166 - 2004-07-04 05:14 PM Re: How to map using USERID to hidden share
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Who are you calling an engineer?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#122167 - 2004-07-04 05:30 PM Re: How to map using USERID to hidden share
BartS Offline
Fresh Scripter

Registered: 2004-07-04
Posts: 5
Nobody, I was just messing around with MSCE or MCSE
as I have seen these before and now it
is different again
_________________________
Pls change my email AT will become @ and X should be dots

Top
#122168 - 2004-07-04 05:38 PM Re: How to map using USERID to hidden share
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Actually, when using the recommended
Code:

$rc=setoption('novarsinstrings','on')


single '$' signs are fine, thus
Code:

use x: '\\server\share\'+@USERID+'$'

_________________________
There are two types of vessels, submarines and targets.

Top
#122169 - 2004-07-04 05:41 PM Re: How to map using USERID to hidden share
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
No, no, no, Jens... you are nesting shares!
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#122170 - 2004-07-04 05:46 PM Re: How to map using USERID to hidden share
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
and if we are to digress...

Borrowing from the KiX2001.txt:
Quote:

Fixes/enhancements in 4.10:
- Variable with zero-length name ('$') is no longer resolved when used
inside strings.



_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#122171 - 2004-07-04 05:48 PM Re: How to map using USERID to hidden share
BartS Offline
Fresh Scripter

Registered: 2004-07-04
Posts: 5
Agree... but you should not have that \share\ in
between the server name and the @USERID.

I have CSE'd and tested that the SE was right.
_________________________
Pls change my email AT will become @ and X should be dots

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.086 seconds in which 0.047 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org