Dear,

We have look at your code.
Your code:

code:

BREAK OFF

; ASSIGN VARIABLES FOR HOME & WORKGROUP DIRECTORIES
$X="$$"
$S1="\\SOMLH2\"

; MAP HOME DIRECTORIES ACCORDING TO CLOSEST SERVER
$U=@USERID
$HOME=$S1+$U+$X

USE F: $HOME ; MAP PERSONAL SHARE, HOME DIRECTORY

; MAP WORKGROUP DRIVES

IF INGROUP("SOM\SOMDEAN_ISU")
USE G: $S1+"ISU$"
ENDIF



Some remarks about your code

  • first use use X: /delete for unwanted network mappings.
  • use
    code:

    IF (@error <> 0)
    ? "Warning "+@error+": "+@serror
    ENDIF


    to see possible mapping problems
  • INGROUP("SOM\SOMDEAN_ISU") isn't correct.
    You may using ingroup("somdean_isu") or ingroup("\\som\somdean_isu").
    (see our example about the differences. som\somdean_isu will
    always return a ZERO value.
  • use ingroup("group_name") <> 0. in this case it isn't
    important which group type you have defined.

In our example we are a server with domain server and
as user temp. We are mapping I + M drive.
Script for testing:

code:

cls
break on
use i: /delete
use m: /delete

; ASSIGN VARIABLES FOR HOME & WORKGROUP DIRECTORIES
$x="$$"
$s1="\\server\"
; MAP HOME DIRECTORIES ACCORDING TO CLOSEST SERVER
$u="temp" ; @USERID
$home=$s1+$u+$x
? " map: USE I: "+$home
use i: $home ; MAP PERSONAL SHARE, HOME DIRECTORY
IF (@error <> 0)
? "Warning "+@error+": "+@serror
ENDIF
; MAP WORKGROUP DRIVES

? " \\server\domain admins "+INGROUP("\\server\Domain Admins")
? " server\domain admins "+INGROUP("server\Domain Admins")
? " domain admins "+INGROUP("Domain Admins")

IF (ingroup("\\server\Domain Admins") <> 0)
? " map: USE M: "+$s1+"temp$"
use m: $s1+"temp$" ; +"ISU$"
IF (@error <> 0)
? "Warning "+@error+": "+@serror
ENDIF
ELSE
? " no map: USE M: "+$s1+"temp$"
ENDIF
use list


Output to your screen can be:

code:

map: USE I: \\server\temp$
\\server\domain admins 1
server\domain admins 0
domain admins 1
map: USE M: \\server\temp$
Current redirections :

I: --> \\SERVER\temp$
M: --> \\SERVER\temp$
(null) --> \\SERVER\IPC$

End of list.


The output of the net use can be:

code:

New connections will not be remembered.

Status Local Remote Network
-------------------------------------------------------------------------------
OK I: \\SERVER\temp$ Microsoft Windows Network
OK M: \\SERVER\temp$ Microsoft Windows Network
The command completed successfully.



We hope you get an idea about the usage of some kixtart functions.
Greetings.

------------------
Site map:

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA