Page 1 of 1 1
Topic Options
#119416 - 2004-05-12 06:16 PM Map drive
Pascal Offline
Fresh Scripter

Registered: 2004-04-05
Posts: 28
Loc: Paris, France
Hi guys,

I have some problems with the mapping drive!
It disconnect properly the old mapping but doesn't remap. It works only on each computers.

Here is the script I used:

$SHRServer1=Server1
$SHRServer2=Server1

********** Connect Common and Private shared
:SHARED

;Disconnect Previous Connections
USE N: /DELETE
USE M: /DELETE

;Connect Common Drive
USE N: "\\+$SHRServer1+\common"
;Connect personnal Drive
USE M: \\+$SHRServer2+\+$UserID+"$$"

So I Don't see the mistake, I'd like something working everytime!
Thank in advance for your help.

Regards, Pascal

Top
#119417 - 2004-05-12 06:24 PM Re: Map drive
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Pascal,

Look at the comments below..
Code:

$SHRServer1="Server1"
; -- IS IT NOT Server2?
$SHRServer2="Server2"

; -- NEED TO COMMENT OUT THE NEXT LINE
;********** Connect Common and Private shared
:SHARED

;Disconnect Previous Connections
; -- MAY NEED TO ADD A /PERSISTENT to remove Persistent connections
USE N: /DELETE
USE M: /DELETE

;Connect Common Drive
; -- QUOTING IS WRONG
USE N: "\\"+$SHRServer1+"\common"
;Connect personnal Drive
; -- QUOTING IS WRONG
; -- Is it not @USERID ?
; -- UNCOMMENT OUT THE NEXT LINE, IF YOU WANT
; USE M: "\\"+$SHRServer2+"\"+@USERID+"$$"
; - REMOVE THE NEXT LINE IF THE PREVIOUS LINE IS WHAT YOU WANT
USE M: "\\"+$SHRServer2+"\"+$UserID+"$$"



HTH,

Kent


Edited by kdyer (2004-05-12 06:26 PM)
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#119418 - 2004-05-12 06:27 PM Re: Map drive
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Quotes look a bit off. Try this...

Quote:

$SHRServer1="Server1"
$SHRServer2="Server1"

;********** Connect Common and Private shared
:SHARED

;Disconnect Previous Connections
USE N: /DELETE
USE M: /DELETE

;Connect Common Drive
USE N: "\\"+$SHRServer1+"\common"
;Connect personnal Drive
USE M: "\\"+$SHRServer2+"\"+$UserID+"$$"




I also didnt see you specifying the $UserID anywhere. Are you sure you arent getting this confused with @UserID?

Top
#119419 - 2004-05-12 06:29 PM Re: Map drive
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
actually, for the personal drive, persistent is about as MUST as it gets.
_________________________
!

download KiXnet

Top
#119420 - 2004-05-12 06:30 PM Re: Map drive
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Also, you may want to visit - Proper use of quotes

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#119421 - 2004-05-12 06:50 PM Re: Map drive
Pascal Offline
Fresh Scripter

Registered: 2004-04-05
Posts: 28
Loc: Paris, France
Thank you gentlemen for your help.

You are right Kent my problem is the quotes thanks for the link

Another question:

I would like to replace in the registry a value.

How to check quickly in the registry this value and replace it?

Top
#119422 - 2004-05-12 06:56 PM Re: Map drive
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
see Readvalue() and Writevalue() in the manual

Additionally, the keyexist() statement is useful
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#119423 - 2004-05-12 07:08 PM Re: Map drive
Pascal Offline
Fresh Scripter

Registered: 2004-04-05
Posts: 28
Loc: Paris, France

In fact The only information I have it is the value of the data.

I don't know where is store the value in the registry.
It is aleatory for each users.

I don't have the information about the subkey the only way is to search the value concerned in the registry and replace by the right value with "writevalue" command.

Top
#119424 - 2004-05-12 07:22 PM Re: Map drive
Pascal Offline
Fresh Scripter

Registered: 2004-04-05
Posts: 28
Loc: Paris, France

I found some ways in the UDF collection sie (http://www.gwspikval.com/jooel/UDF/) to search a valuename in registry!

This site is amazing

Top
#119425 - 2004-05-12 07:34 PM Re: Map drive
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you are absolutely right!
_________________________
!

download KiXnet

Top
#119426 - 2004-05-12 08:17 PM Re: Map drive
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
ROFL
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
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.07 seconds in which 0.033 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