Page 1 of 1 1
Topic Options
#47216 - 2003-10-23 12:11 AM %username% variable problem....
Cary Shultz Offline
Fresh Scripter

Registered: 2003-10-20
Posts: 14
Loc: Roanoke, VA
Howdy! Howdy!

I have made two posts this week and have had some great help. However, I have one remaining issue. I am using Kixtart 2001 version 4.21...

We are running a pure WIN2000 environment with one Novell Server ( on its way out ). We have three situations where we make use of the common %username% variable in the current logon script. However, we are switching to KixTart for the logon script language as it is far superior to the .bat / .cmd options.

I have searched through the BB and the Manual but can not quite get this to work.

For example, there is a situation where everyone in the company has a mapped network drive to his/her own folder located in the Shared Folder "SCANS" located on SERVER01. This is really easy as we simply use
code:
 net use P: \\SERVER01\SCANS\%username% 

and there you have it.

I am trying to do the same thing with KixTart. I looked specifically at the posting by 'brothercool' and he seems to be having the same problem that I am. I tried to make use of

code:
 USE P: "\\SERVER01\Scans" + @USERID

but that does not want to work. I do not have a P:\ when I next logon. BTW - I am using a test user account for this in the production environment. I can manually map to that particular folder and can access the contents so it is not a permission / access issue.

Furthermore, once I remove "+ @USERID" I do indeed get a mapped network P:\ drive!!!

Does anyone see what I am doing incorrectly. If you want / need to entire logon script I will gladly post it.

The folder is named 'kixtart' which is the logon name for this user ( First Name = Kix and Last Name = Tart ).

Thanks for everyone's help. I am sorry that I am just not getting this!!!! Well, not yet!

Thanks all,

Cary

Top
#47217 - 2003-10-23 12:34 AM Re: %username% variable problem....
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Cary,

Please - it is KiXtart!

Instead of -
code:
USE P: "\\SERVER01\Scans" + @USERID

You will want -
code:
USE P: "\\SERVER01\Scans\" + @USERID

Note: The extra backslash.

If it is an Admin share, you may need extra "$$" for it.

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#47218 - 2003-10-23 12:34 AM Re: %username% variable problem....
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
How about adding the \

USE P: "\\SERVER01\Scans\" + @USERID

KENT IS FAST [Razz]

[ 23. October 2003, 00:35: Message edited by: NTDOC ]

Top
#47219 - 2003-10-23 01:40 AM Re: %username% variable problem....
Cary Shultz Offline
Fresh Scripter

Registered: 2003-10-20
Posts: 14
Loc: Roanoke, VA
Thank you to the both of you. Please excuse my typo. In the script it is as both of you suggested:
code:
 USE P: "\\SERVER01\Scans\" + @USERID 

I was going from memory here at home. Just for good measure I tried here on my test lab and am not able to get it to work.

However, I am able to get the H:\ drive to work. Simply replace "SCANS" from above with "USERS". Go figure.

This is really starting to frustrate me. [Confused]

Sorry!

Thanks again,

Cary

Top
#47220 - 2003-10-23 01:55 AM Re: %username% variable problem....
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Next step, what does this tell us ?

USE P: "\\SERVER01\Scans\" + @USERID

?"ERROR @ERROR : @SERROR"

Top
#47221 - 2003-10-23 02:55 AM Re: %username% variable problem....
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You might want to do a
code:
se p: /delete /persistent

first or, even better, switch to any of the 'map drive' UDFs that are posted in the UDF Forum.
_________________________
There are two types of vessels, submarines and targets.

Top
#47222 - 2003-10-23 04:36 AM Re: %username% variable problem....
Cary Shultz Offline
Fresh Scripter

Registered: 2003-10-20
Posts: 14
Loc: Roanoke, VA
Thanks, Guys!

Okay. Here is the slightly abridged ( only changed the server names ) logon.kix file that I am running for two test user accounts in the production environment. I am really sorry that this is such a pain in the arse!

code:
 $rc=SETCONSOLE("HIDE")
;Kixtart logon script
;created: 10/22/2003
;Author: Cary W. Shultz

USE * /DELETE

USE G: "\\server01\data\rating"
USE H: "\\server01\" + @USERID
USE I: "\\server01\apps"
USE J: "\\server01\apps\spdata"
USE L: "\\server01\data"
USE M: "\\server01\data\applied"
USE N: "\\server01\data\tam_data"
USE O: "\\server04\images"
USE P: "\\server04\scan"
USE Q: "\\server04\unrouted"
USE S: "\\server01\software"


IF @USERID = "ADMINISTRATOR" or @USERID = "Support"
USE T: "\\w2kserver04\software"
ELSE
SELECT
CASE InGroup("GSG_Roanoke")
USE T: "\\w2kserver04\software"
CASE InGroup("GSG_Blacksburg")
USE T: "\\w2kserver04\software"
CASE InGroup("GSG_Richmond")
USE T: "\\w2kserver04\software"
ENDSELECT
ENDIF

EXIT 0

Part of the problem right now is that the H:\ drive does not map ( will worry about that at a later time as this is going to be slightly different once the Novell Server is removed from production - we still need to move over the user data that corresponds to this ).

However, my immediate concern is the P:\. Please bear in mind that I have removed the "+ @USERID" part of that mapping.

Just for grins, here is how it was when I actually attempted it ( and the cause of my headache! ):

code:
  $rc=SETCONSOLE("HIDE")
;Kixtart logon script
;created: 10/22/2003
;Author: Cary W. Shultz

USE * /DELETE

USE G: "\\server01\data\rating"
USE H: "\\server01\" + @USERID
USE I: "\\server01\apps"
USE J: "\\server01\apps\spdata"
USE L: "\\server01\data"
USE M: "\\server01\data\applied"
USE N: "\\server01\data\tam_data"
USE O: "\\server04\images"
USE P: "\\server04\scan\" + @USERID
USE Q: "\\server04\unrouted"
USE S: "\\server01\software"


IF @USERID = "ADMINISTRATOR" or @USERID = "SUPPORT"
USE T: "\\w2kserver04\software"
ELSE
SELECT
CASE InGroup("GSG_Roanoke")
USE T: "\\w2kserver04\software"
CASE InGroup("GSG_Blacksburg")
USE T: "\\w2kserver04\software"
CASE InGroup("GSG_Richmond")
USE T: "\\w2kserver04\software"
ENDSELECT
ENDIF

EXIT 0

With this 'code' there was no P:\ mapped at all - as mentioned in my earlier post. With the code posted above this ( without the + @USERID ) the P:\ drive is mapped...

I will add the ?"ERROR @ERROR : @SERROR" line. I do thank all of you for your patience and assistance. Other than simple mapped network drives I do not do much with logon scripts so a lot of the concepts are a bit foreign to me.

Thanks again,

Cary

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
1 registered (Allen) and 1198 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.059 seconds in which 0.028 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