#133785 - 2005-02-15 12:11 AM
New server problem
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
I wound up cobbling together the following code to remove a persistent mapping when folks are logging in: Code:
IF Exist('R:') SHELL '%COMSPEC% /C NET USE R: /D > nul' SLEEP 2 ENDIF USE R: /delete /persistent IF 0=Exist('R:') USE R: '\\NEWSERVER\APPS' ENDIF
Not only did I have to do this for our main login script, but had to do this for our Citrix boxes as well. It seems to me that this is over-kill, but it worked when I needed it this morning. 
Thanks,
Kent
|
|
Top
|
|
|
|
#133787 - 2005-02-15 12:51 AM
Re: New server problem
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Why? You have this code...
Code:
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
WriteLog ($LogText + $x)
WriteLog2("%temp%\MapDrive.log",$LogText + $x,1)
Color w+/n
Else
WriteLog ("Function 'MapDrive' called with invalid parameters: '$Drive', '$Server', '$Share'")
Endif
Endfunction
|
|
Top
|
|
|
|
#133790 - 2005-02-15 12:58 AM
Re: New server problem
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Hence my question...Why? To date I have not had to resort to such things...
|
|
Top
|
|
|
|
#133793 - 2005-02-15 08:33 AM
Re: New server problem
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Guys.. I am working on using the Mapdrive UDF() as well as making all of our script UDF-based. This will make this easier to troubleshoot with known tried-and-true methods. Thanks Jens. It was a pretty hectic day today with this. What I need is a clean solution for removal of the old drives..
To lay this out a bit better: Local workstation logins were using persistent Citrix boxes were not using persistent
Both the local and Citrix were acting with the persistent in place.
Definitely odd.
Thanks,
Kent
|
|
Top
|
|
|
|
#133795 - 2005-02-15 08:35 PM
Re: New server problem
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
You are "preaching to the choir" here. Our login script was handed over to me. I am working on a new version that will use Jens MAPDRIVE() UDF and will be much better than the methods we have used.
Kent
|
|
Top
|
|
|
|
#133797 - 2005-02-15 11:13 PM
Re: New server problem
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
I am still here, but not as much as I used to be.. 
Kent
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 1198 anonymous users online.
|
|
|