Page 1 of 1 1
Topic Options
#201324 - 2011-01-04 03:36 PM Old drive mappings return
phlight Offline
Fresh Scripter

Registered: 2010-10-18
Posts: 6
Loc: NJ
I've come into a situation where the drive mappings were done with batch files and the letters used were inconsistent between the users. I think that my script was unmapping the drives correctly using "USE * /DELETE /PERSISTENT" but the old drive letter mappings are coming back. I'm thinking that the people have shortcuts on their desktops that are remapping the drives under the old letter but I'm not sure that's the case. How are these old letters coming back and what can I do to prevent it?

Thanks,

Top
#201325 - 2011-01-04 04:45 PM Re: Old drive mappings return [Re: phlight]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Welcome to KORG!

Joisey? What exit? \:D (Between 16W and 157 here..)

What does your user profile look like - is it calling a bat file or the Kix32.exe directly?

Have you looked at the affected system? Does it have shortcuts? I've seen sites where there were bat files on desktops to map drives...

Have a user log into the affected system, open a command prompt and type "net use" - are the mappings as you'd expect? Check again later - do the connections reappear after the user works for a while? This will help isolate whether the problem is happening during logon or later during operation.

What version of Kix are you using? Some older ones did not always clear persistent connections, and we used to use Shell 'NET USE * /DELETE /Y' instead of the built-in command. Should not be an issue with 4.53 and above.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#201332 - 2011-01-05 02:22 PM Re: Old drive mappings return [Re: Glenn Barnas]
phlight Offline
Fresh Scripter

Registered: 2010-10-18
Posts: 6
Loc: NJ
Between 8A and 7 a little too south for a joisey exit but I do say wuder instead of water.

The profile calls a bat file to launch wkix32.exe. It is part of a group policy so you can't launch an exe directly.

The user doesn't not have a batch file to manually map the drives

When the user logs on the drives are correct, after using the computer for a bit the old letters are added to the correct current drive letters.

We're using the latest, just downloaded it a couple of months ago.

Thanks,

Top
#201339 - 2011-01-06 02:42 PM Re: Old drive mappings return [Re: phlight]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
OK - so clearly the login script is doing what you'd expect - removing the old connections and establishing the desired connections. You'll need to look elsewhere to determine what is mapping the old drives. I'd wager there might be a bat file that maps drives when launching an app.

This might require you running a "NET USE" command after launching each app that the user runs to determine a relationship between an app and the mapped drives. Also, does the user have shortcuts to these locations on their desktop?

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#201340 - 2011-01-06 09:41 PM Re: Old drive mappings return [Re: Glenn Barnas]
phlight Offline
Fresh Scripter

Registered: 2010-10-18
Posts: 6
Loc: NJ
On the few users I checked out it appears this is all happening because they have shortcuts on their desktop that reference the old letter. My assumption was that they would get an error that they couldn't open up the file.

Man that is stupid. I doubt that there is any real solution to that. I look forward to migrating to Sharepoint. I'm sure that will bring along its own pain though.

Do you have any suggestions?

Thanks,

Top
#201341 - 2011-01-06 10:04 PM Re: Old drive mappings return [Re: phlight]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4572
Loc: USA
Pseudo Code...

 Code:
$NetDriveToRemove="R:"
for each $shortcut in dirplus("%userprofile%\desktop","/f lnk")
  if left(GetShortcutProperties($Shortcut,"Path"),2)=$NetDriveToRemove
    ;del $shortcut
    ;and Recreate the Shortcut using WSHShortcut() with new perms
  endif
next


DirPlus() - http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=82153#Post82153
GetShortcutProperties() - http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=182375#Post182375
WSHShortcut() - http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=84115#Post84115

How to use UDFs -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81943#Post81943

The rest of the UDFs are here -
http://www.kixtart.org/forums/ubbthreads.php?ubb=postlist&Board=7&page=1
_________________________
(... better days ahead)

Top
#201342 - 2011-01-06 10:27 PM Re: Old drive mappings return [Re: Allen]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Pretty much what Allen suggested, except I might not uncomment the line to recreate the new shortcut! \:D

BTW - the one thing Allen didn't include is storing the old shorcut properties first.. You'll likely want to examine the properties, prepare the correct set of parameters, then delete and finally create the new shortcut based on the new parameters.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#201348 - 2011-01-10 11:49 PM Re: Old drive mappings return [Re: Allen]
phlight Offline
Fresh Scripter

Registered: 2010-10-18
Posts: 6
Loc: NJ
Some of the users were manually mapping their drives and picking a letter at random. Any way for the code to be modified to work when you don't know the original drive letter used?
Top
#201349 - 2011-01-11 12:46 AM Re: Old drive mappings return [Re: phlight]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4572
Loc: USA
More Pseudo... there is probably a better way to do this... the problem is this doesn't take into account the proper drives... might need to create a INI to compare the results.

 Code:
$PathToFind="\\server\share"
for each $drive in enumnetworkdrives()
  $letter=split($drive,",")[0]
  $path=split($drive,",")[1]
  if $path=$PathToFind
    for each $shortcut in dirplus("%userprofile%\desktop","/f lnk")
      if left(GetShortcutProperties($Shortcut,"Path"),2)=$letter
      ;getshortcutproperties
      ;del $shortcut
      ;and Recreate the Shortcut using WSHShortcut() with new params
      endif
    next
  endif
next


EnumNeworkDrives() - http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=138356

How to use UDFs -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81943#Post81943

The rest of the UDFs are here -
http://www.kixtart.org/forums/ubbthreads.php?ubb=postlist&Board=7&page=1
_________________________
(... better days ahead)

Top
#201350 - 2011-01-11 02:05 PM Re: Old drive mappings return [Re: Allen]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Don't forget to read the header and include the QS udf as it is a dependency of EnumNetworkDrives.

Our Kix-based login script (see my web site) deals with this situation by defining a list of "ad-hoc" drive letters that users may employ for custom mappings. The script then unmaps all drives except for those in that list.

To keep administrative control, we limit the ad-hoc list to 3-4 drive letters at most, even on small networks. We tell users that those are the only letters available for personal use, and that all other drives will be unmapped at login.

It sounds like you need to get some business policies under control in addition to these firefighting scripts.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#201351 - 2011-01-11 02:24 PM Re: Old drive mappings return [Re: Glenn Barnas]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
 Originally Posted By: Glenn Barnas

...
and include the QS udf as it is a dependency of EnumNetworkDrives.
...


Sorry Glenn but it is not a dependency. Doc used it on the example but it will work just fine without the QS UDF.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#201352 - 2011-01-11 04:24 PM Re: Old drive mappings return [Re: Mart]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Yeah, sorry.. it was the line under "Dependencies" so my old and feeble brain simply put it together, ignoring the "Example" header to the left.

Don't grow old, my friend! \:D

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#201360 - 2011-01-12 09:14 AM Re: Old drive mappings return [Re: Glenn Barnas]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
 Originally Posted By: Glenn Barnas

...
Don't grow old, my friend! \:D
...


I'm trying my best but when I see new people coming into our company that are born in the late 80's or early 90's I see that my efforts are useless
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#201496 - 2011-02-05 02:28 AM Re: Old drive mappings return [Re: Mart]
phlight Offline
Fresh Scripter

Registered: 2010-10-18
Posts: 6
Loc: NJ
Sorry for the delayed response.

This seems like it's more involved than I'd like. Would it be easier to somehow prevent the old drive letters from being mapped when they click on shortcuts? I know that it would make their shortcuts unusable but that's actually what I expected in the first place when I changed the letters.

Thanks

Top
#201500 - 2011-02-06 02:00 AM Re: Old drive mappings return [Re: phlight]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
http://support.microsoft.com/kb/299780
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#201533 - 2011-02-08 02:10 PM Re: Old drive mappings return [Re: Les]
phlight Offline
Fresh Scripter

Registered: 2010-10-18
Posts: 6
Loc: NJ
Les,

Thanks, I'll give that a shot.

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 756 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.07 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org