Page 1 of 1 1
Topic Options
#200059 - 2010-09-27 12:14 PM it maps ok, it doesnt map ok.
baggies1 Offline
Fresh Scripter

Registered: 2010-05-13
Posts: 9
Loc: suffolk, england
i have recently created a new drive mapping.

a users account when logging onto the test machine will happily map the new drive.

frustratingly this doesnt happen on her own machine. this is the case with a number of our machines.

she has no conflicting host entries, she has no conflicting drive letter conflict.

is there anything i could check?

Top
#200060 - 2010-09-27 12:16 PM Re: it maps ok, it doesnt map ok. [Re: baggies1]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
What is the value of @ERROR and @SERROR after the attempt?

Does it map OK from the command line with NET USE?

Top
#200061 - 2010-09-27 12:18 PM Re: it maps ok, it doesnt map ok. [Re: Richard H.]
baggies1 Offline
Fresh Scripter

Registered: 2010-05-13
Posts: 9
Loc: suffolk, england
apologies but where is the error info
(sorry bit of a newbie)

yes maps ok with net use command

Top
#200062 - 2010-09-27 12:21 PM Re: it maps ok, it doesnt map ok. [Re: baggies1]
baggies1 Offline
Fresh Scripter

Registered: 2010-05-13
Posts: 9
Loc: suffolk, england
this is my current map script with *** where my server name normally is
the last drive is the one i'm having issues with. (N drive)
 Code:
use "*" /DELETE


use U: \\***\***  /persistent:no
use H: \\***\%username%  /persistent:no


if ingroup("***01 users") 
use s: "\\***\***"
endif 


if ingroup("** users") 
use V: "\\***\***03"
endif 


if ingroup("*** users") 
use W: "\\***\***04"
endif  


if ingroup("***") 
use X: "\\***\***"
endif 


if ingroup("*** access") 
use R: "\\***\***"
endif 


if ingroup("*** access") 
use t: "\\***\***"
endif 


if ingroup("***Tdrive") 
use t: /delete 
use t: "\\***\***"
endif 


if ingroup("*** access") 
use i: "\\***\***"
endif 


if ingroup("*** access") 
use q: "\\***\***"
endif 


if ingroup("** access") 
use p: "\\***\**"
endif 

if ingroup("*** access") 
use p: /delete 
use p: "\\***\***"
endif 

if ingroup("***") 
use M: "\\***\**"
endif 

if ingroup("*** access") 
use K: "\\***\***"
endif 

if ingroup("*** access") 
use j: "\\***\***"
endif 

if ingroup("***") 
use n: "\\***\***"
endif






Edited by Glenn Barnas (2010-09-27 12:25 PM)
Edit Reason: added code tags

Top
#200063 - 2010-09-27 12:24 PM Re: it maps ok, it doesnt map ok. [Re: baggies1]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
Welcome to KORG!

I'd add
 Code:
  If @ERROR
    @SERROR @CRLF
  EndIf
after each "use" command.

Glenn

PS - wrap your code in the appropriate tags to format it - [ code ] my script... [ /code ] - but without any spaces around the tag name.
_________________________
Actually I am a Rocket Scientist! \:D

Top
#200064 - 2010-09-27 12:30 PM Re: it maps ok, it doesnt map ok. [Re: Glenn Barnas]
baggies1 Offline
Fresh Scripter

Registered: 2010-05-13
Posts: 9
Loc: suffolk, england
thanks

so like this

 Code:
if ingroup("***") 
use n: "\\***\***"
  If @ERROR
    @SERROR @CRLF
EndIf


so if an error does it appear onscreen? is logged in c drive somewhere?

Top
#200065 - 2010-09-27 12:59 PM Re: it maps ok, it doesnt map ok. [Re: baggies1]
baggies1 Offline
Fresh Scripter

Registered: 2010-05-13
Posts: 9
Loc: suffolk, england
If InGroup("mydomain\G-Mitarbeiter")
Use P: /delete /persistent
? "Deleting P drive"
? @ERROR
? @SERROR
Use P: "\\mydomain\dfs\projekte"
?"Mapping P drive."
? @ERROR
? @SERROR
EndIf

taken from another script , this kinda look what i want.

i really need to dump the results to the users local c drive everytime they login to track mapping errors.
where does the @error get recorded?
onscreen is no good and i dont want each user having o hit the return key several times.
also in my script i dont use my domain. should i?


Edited by baggies1 (2010-09-27 12:59 PM)

Top
#200066 - 2010-09-27 01:00 PM Re: it maps ok, it doesnt map ok. [Re: baggies1]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
You're missing the "EndIf" after the "If @ERROR", but otherwise, yes - that's the idea.

Each If needs a matching EndIf.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#200067 - 2010-09-27 01:07 PM Re: it maps ok, it doesnt map ok. [Re: Glenn Barnas]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
That example might be good for debugging, but most users are annoyed by "chatty" login scripts.

The example I gave you will display a message only if an error occurs.

Our commercial login script displays the drive and map in green on success, red on failure, and sets an error flag. At the end of the script, if the error flag is set, we wait for a user keypress or a timer to expire. This way, the user is aware that an error occurred and can contact support, otherwise the login script runs and disappears in 3-4 seconds.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#200068 - 2010-09-27 01:09 PM Re: it maps ok, it doesnt map ok. [Re: Glenn Barnas]
baggies1 Offline
Fresh Scripter

Registered: 2010-05-13
Posts: 9
Loc: suffolk, england
hmm yes that can be a problem cant it.

if the script crashes out half way through its only half job done..(my "end if's" causing the issues)

i'm trying to decyfer the kixstart bible but not entirely sure..

i still need to dump the results to the root of the c drive or something..

even if succesful...would be a good first line tool for issues on all pc's.
and also wouldnt disturb the user.

what does the "?" do in the example above? dump to screen or some default file?


Edited by baggies1 (2010-09-27 01:11 PM)

Top
#200069 - 2010-09-27 01:22 PM Re: it maps ok, it doesnt map ok. [Re: baggies1]
baggies1 Offline
Fresh Scripter

Registered: 2010-05-13
Posts: 9
Loc: suffolk, england
i think my issue maybe caching.

the group my user should be a member of (and is in AD) isnt listed in the current user registry.

i've run wkix32.exe /f to flush the cache in the registry
i re-ran the script but still didnt map the drive i wanted.

do i need to flush , then reboot first?


Edited by baggies1 (2010-09-27 01:24 PM)

Top
#200070 - 2010-09-27 02:10 PM Re: it maps ok, it doesnt map ok. [Re: baggies1]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
The "?" is a shortcut for a CR/LF sequence, which is usually at the end of a line. Coders that are used to BASIC sometimes think of it as a PRINT statement, since "?" is a BASIC shortcut for PRINT. As such, it winds up at the beginning of the line.

Running Kix32 /f will flush the cache without needing a reboot, but the data is already cached for that sesssion. There are ways to manually flush the cache by deleting a registry key.

The SANITY UDF will scan your code and look for common errors in syntax, including mismatches of quotes, parens, and paired expressions like If/EndIf. Get the copy from my web site as it was updated recently and the copy here is over a year old.

A simple way to write a debug log is to use one of the message UDFs. I just posted fMsg() today. Define a global var called $MSG_LOG_ to point to the log file, then add
 Code:
$MsgTxt = 'this is a message... the error was' + @ERROR
fMsg($MsgTxt, , 0, 16)
This will write the message only to the log file. You can even do something fancy:
 Code:
$MsgTxt = 'An error occurred while mapping drive D:'
$LogTxt = 'Drive D:, \\server\share, ' + @SERROR
$fMsg($MsgTxt, $LogTxt)
which will write a short message to the screen and a more detailed message to the log.

Be sure to Del $Msg_Log_ after you define it, otherwise it will keep gathering data from each login session into a single file.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#200071 - 2010-09-27 02:32 PM Re: it maps ok, it doesnt map ok. [Re: Glenn Barnas]
baggies1 Offline
Fresh Scripter

Registered: 2010-05-13
Posts: 9
Loc: suffolk, england
thanks for all your help Glen.

running the flush command on boot up fixed my issue.

there are no latency issues therefore i will run at each bootup.

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 735 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

Generated in 0.064 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

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