Page 1 of 1 1
Topic Options
#1449 - 2000-01-19 02:23 PM Remapping Persistent Connections
Anonymous
Unregistered


I am just starting to use kixtart and I am unable to remap a persistent drive connection. Below is a sample of the script i'm using. I want to force users to have these drive mappings reguardless of what they had mapped prior to using this logon script.

This does seem to work when I run the script from the command line after I have already logon to the machine - this does not seem to work during the normal logon process.

use r: /DELETE /PERSISTENT
use n: /DELETE /PERSISTENT
use o: /DELETE /PERSISTENT
use t: /DELETE /PERSISTENT
use r: @HOMESHR
use n: \\server\utility
use o: \\server\alluser
use t: \\server\cbt

Thanks in advance for any help


Top
#1450 - 2000-01-20 05:10 AM Re: Remapping Persistent Connections
Pierre FREMION Offline
Getting the hang of it

Registered: 2000-01-11
Posts: 66
Loc: Paris, France, Europe, Sun3
Hi
Your kind of script must work on Windows NT computers.

It may encounter troubles for Windows 9x.
See "Known Problems of KiXtart on Windows 9x" in documentation (around page 15 for me)
A paragraph explain that you must delete a key in registry to completly remove the mapping.

HTH

------------------
Comments always welcome.
French native so I apologize for my (mis)use of English!

_________________________
Comments always welcome. French native so I apologize for my (mis)use of English!

Top
#1451 - 2000-01-20 09:16 AM Re: Remapping Persistent Connections
Anonymous
Unregistered


Hello,

Here is some code I wrote to enumerate and/or delete persistent connections. You may then add whatever you want. It works for both NT and Win9x clients.

code:

;****************************************************************************************
:ENUMPERSIST
; Description:
; Enumerate all the user's persistent connections. Want to keep it in a log
; in case the user has a problem.
;
; Input:
; $OS, $HKCU, $user
;
; Output:
; None
;****************************************************************************************
; Modification History
; Date Initials Description
; 11 Aug 98 bvv Wrote first cut.
;****************************************************************************************
;
Dim $index, $persist, $loop_index, $name, $keyname, $p_name, $returncode
$index=0
If $OS="Win9x"
$persist="$HKCU\Network\Persistent"
Else
$persist="$HKCU\Network"
Endif
? "Enumerate the persistent connections: "+$persist
$loop_index=0
While $loop_index=0
$name=EnumKey("$persist",$index)
$loop_index=@ERROR
If $loop_index=0
$keyname=$persist+"\"+$name
$p_name=ReadValue("$keyname","RemotePath")
? "The enumerated value is: "+$name+" and its UNC is: "+$p_name+"."
; If you want to delete the keys, uncomment the next few lines.
; $returncode=DelKey($keyname)
; If $returncode=0
; ? "The persistent connection to "+$p_name+" was deleted."
; ? "The index value is: "+$loop_index+"."
; Else
; ? "There was a problem deleting the persistent connection to: "+$p_name
; Endif
$index=$index+1
Else
If $loop_index=259
; This error should come up when all entries have been enumerated.
? "All persistent connections have been listed."
Else
; An unknown error has occurred.
? "An error has occurred while enumerating persistent connections. The"
? "error number is: "+$loop_index+"."
Endif
Endif
Loop
Return
;

Note: I set $OS to either "Win9x" or "Windows NT" in another subroutine; $HKCU is set to "HKEY_CURRENT_USER" and $user is set to @USERID (I always set a variable to a macro definition if I am going to use it more than once in a script).

Hope this helps.

------------------
Regards,

Brad
Consultant
Net InfraStructure, Inc

Top
#1452 - 2000-01-24 10:24 AM Re: Remapping Persistent Connections
Anonymous
Unregistered


Thanks for your assistance - After some modifications for our needs the script you supplied works great.
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 1179 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.081 seconds in which 0.053 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