Page 1 of 1 1
Topic Options
#130808 - 2004-12-08 12:02 AM Don't get all the map drives
ozraelised Offline
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
#130809 - 2004-12-08 12:16 AM Re: Don't get all the map drives
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Please post using the Instant UBB Code Tags to preserve your code formatting when posting.

You can try launching your script with the /F switch, and also try adding the Domain name to the InGroup check.

If InGroup("Your Domain\JMME-General")

Top
#130810 - 2004-12-08 01:30 AM Re: Don't get all the map drives
Howard Bullock Offline
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


_________________________
Home page: http://www.kixhelp.com/hb/

Top
#130811 - 2004-12-08 03:03 AM Re: Don't get all the map drives
ozraelised Offline
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
#130812 - 2004-12-08 03:25 AM Re: Don't get all the map drives
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
As much a s we'd like to help you, if you don't start providing more details we won't be able to diagnose anything. Did you try the script exactly as it was posted? Did you run it directly from the command line first? Have you made yourself familiar with debugging a script as described in the KiXtart Manual? Does the script run at all? Where does it fail? What are the eooror code(s) at the point of failure?
_________________________
There are two types of vessels, submarines and targets.

Top
#130813 - 2004-12-08 03:35 AM Re: Don't get all the map drives
Howard Bullock Offline
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.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#130814 - 2004-12-08 05:45 AM Re: Don't get all the map drives
ozraelised Offline
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 Offline
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.
_________________________
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

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.058 seconds in which 0.032 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