#130808 - 2004-12-08 12:02 AM
Don't get all the map drives
|
ozraelised
Getting the hang of it
Registered: 2002-12-02
Posts: 59
Loc: Albury
|
Hi,
Thank to NTDOC and Shawn I got the follwoing script Up to the second IF Can any one help me with why I get only the 2 drive one is the k drive which I set on the user profile and the other one is the last one the Z drive.
Dim $0S $OS=SetOption('Explicit','off') $OS=SetOption('NoVarsInStrings',On) $OS=SetOption('WrapAtEOL','On')
Dim $Msg,$Answer
$Answer = MessageBox ("please confirm that you have read and understood the firm's IT policy. If you have any questions relative to this please contact Gary or Rae", "Remider", 4180)
If $Answer <> 6 $Msg=MessageBox ( "You are unable to log to the network", "call your IT Administrator", 4112) Logoff(1) Else ;$ = shutdown("","you are being logged off",45,1,1) $Msg=MessageBox ("You are now beeing connected to the network","Welcome to Johnsons MME",64,5) Endif
If InGroup("JMME-General")
use f: "\\jmmes\Vol1"
use g: "\\jmmes\mCalas"
use h: "\\jmmes\caldata"
use i: "\\jmmes\s6system"
use j: "\\jmmes\winapp"
; K: Drive Mapped by OS as Home Share
use l: "\\jmmes\abas"
use m: "\\jmmes\vol1"
use n: "\\jmmes\netapps"
use o: "\\jmmes\JMME-FPlan"
use p: "\\jmmes\apps"
use q: "\\jmmes\NotesMME"
use s: "\\jmmes\vol2"
use t: "\\jmmes\templates"
use y: "\\jmmes\PWCDll"
use z: "\\jmmes\Mcalasutils" Endif
|
|
Top
|
|
|
|
#130810 - 2004-12-08 01:30 AM
Re: Don't get all the map drives
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Missing quotes: OS=SetOption('NoVarsInStrings',On)
try this (what is the result?):
Code:
Dim $0S, $Msg, $Answer, $RC
$OS=SetOption('Explicit','off')
$OS=SetOption('NoVarsInStrings','On')
$OS=SetOption('WrapAtEOL','On')
$Answer = MessageBox ("please confirm that you have read and understood the firm's IT policy. If you have any questions relative to this please contact Gary or Rae", "Reminder", 4180)
If $Answer <> 6
$Msg=MessageBox ( "You are unable to log to the network", "call your IT Administrator", 4112)
$RC=Logoff(1)
Else
;$ = shutdown("","you are being logged off",45,1,1)
$Msg=MessageBox ("You are now beeing connected to the network","Welcome to Johnsons MME",64,5)
Endif
If InGroup("JMME-General")
MapDrive("F:", "jmmes", "Vol1")
MapDrive("G:", "jmmes", "mCalas")
MapDrive("H:", "jmmes", "caldata")
MapDrive("I:", "jmmes", "s6system")
MapDrive("J:", "jmmes", "winapp")
; K: Drive Mapped by OS as Home Share
MapDrive("L:", "jmmes", "abas")
MapDrive("M:", "jmmes", "vol1")
MapDrive("N:", "jmmes", "netapps")
MapDrive("O:", "jmmes", "JMME-FPlan")
MapDrive("P:", "jmmes", "apps")
MapDrive("Q:", "jmmes" ,"NotesMME")
MapDrive("S:", "jmmes", "vol2")
MapDrive("T:", "jmmes", "templates")
MapDrive("Y:", "jmmes", "PWCDll")
MapDrive("Z:", "jmmes", "Mcalasutils")
Endif
Function MapDrive($Drive, $Server, $Share)
Dim $Drive, $Server, $Share, $shell
Color c+/n
If $Drive<>"" and $Server<>"" and $Share<>""
$LogText="Connecting $Drive to \\$Server\$Share"
? $LogText
USE $Drive /Delete /Persistent
USE $Drive "\\" + $Server + "\" + $Share
If @error=0
color g+/n
$x = " - Success"
$x
If val($DOS) >= 5
$shell=createobject("shell.application")
$shell.namespace($Drive+"\").self.name=$Share + " on '" + $Server + "'"
$shell = 0
Endif
Else
color r+/n
$x = " - Failed: Error " + @error
$x
$ErrorState=1
Endif
; Commented out logging
;WriteLog ($LogText + $x)
;WriteLog2("%temp%\MapDrive.log",$LogText + $x,1)
Color w+/n
Else
? "Function 'MapDrive' called with invalid parameters: '$Drive', '$Server', '$Share'"
; Commented out logging
;WriteLog ("Function 'MapDrive' called with invalid parameters: '$Drive', '$Server', '$Share'")
Endif
Endfunction
|
|
Top
|
|
|
|
#130811 - 2004-12-08 03:03 AM
Re: Don't get all the map drives
|
ozraelised
Getting the hang of it
Registered: 2002-12-02
Posts: 59
Loc: Albury
|
Hi
Try to run the code with no luck still get no drive I have got a script that use to work fine but it was run using a batch file and as the second script on the batch file, all I did is copy the code to the one script.
|
|
Top
|
|
|
|
#130813 - 2004-12-08 03:35 AM
Re: Don't get all the map drives
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
add an ELSE construct for the IF INGROUP to see if the INGROUP is not giving you what you expect.
|
|
Top
|
|
|
|
#130814 - 2004-12-08 05:45 AM
Re: Don't get all the map drives
|
ozraelised
Getting the hang of it
Registered: 2002-12-02
Posts: 59
Loc: Albury
|
hi,
What can I say but Thank you. All is working, sometime I am running ahead, I use the Kix32 /d and I didn't get an erro but the script finished to run (press the F8) so it was the condition of the group, I do appologise to all but the group was empty (as I said I run insted of thinking) so all is working fine.
I looked at the manual and for the function Mapdrive and I couldn't find any thing can you send me some information so I will be able to understend the script. Also with the log if it writes to the cmd on the screen I am unable to see it, I don't wish for the user to be able to see any things apart from the messages.
Thanks
|
|
Top
|
|
|
|
#130815 - 2004-12-08 08:40 AM
Re: Don't get all the map drives
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,
MapDrive isn't an internal function of kixtart. It is an UDF script which you can find on the UDF forum. For an easy way of searching see UDF's Jooel greetings.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|