Solved

Add mapped network drives to computer search path

Posted on 2009-05-14
3
267 Views
Last Modified: 2012-05-07
Greetings,
Back in the popular days of Novell NetWare, there was a nice ability to define 'search drives' in a login script.  These were special network drive mappings that appeared as if they were in the local computer's PATH.    

Therefore my first question would be:  does anyone know of some equivalent app to use for Windows?

Assuming the answer of 'no', my next question is:  can anyone provide some pointers on improving an existing script?  

Enclosed is a script my predecessor used to accomplish the goal.  I don't know VB myself, but I can follow along with what it's supposed to do.  While the script does come close to what I need, it also has some drawbacks:
1. It doesn't seem to work on Vista workstations.

2. On some workstations it doesn't recognize that the script has been processed before.  It's not uncommon to see a machine with these drives added three, four, sometimes even five times to the local PATH.  Meanwhile other machines have the PATH set correctly.

3. I'd like the ability of removing these entries altogether when a user logs out from the LAN (mainly for people working offline).  I know this would be a separate script, but I'm uncertain on how to do this.

I appreciate any advice you can offer.  Thanks!


Const ForReading = 1

Dim WSHShell,strAutoLogon,strPassword,strNeed,MaybeneedW,MaybeneedX,MaybeneedY,MaybeneedZ

MaybeneedW=1

MaybeneedX=1

MaybeneedY=1

MaybeneedZ=1

strNeed=""

Set WSHShell = WScript.CreateObject("WScript.Shell")

strOrgPath = WSHShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\path")

Searchpath=Split(strOrgPath,";")

y=UBound(Searchpath)

x=0

While x<=y

	Wisthere=StrComp("W:\BIN\SETUP\",Searchpath(x),1)

	Xisthere=StrComp("X:\BIN\PGM\",Searchpath(x),1)

	Yisthere=StrComp("Y:\bin\src\",Searchpath(x),1)

	Zisthere=StrComp("Z:\public\",Searchpath(x),1)

	If Wisthere=0 then

			MaybeneedW=0

	End If	

	If Xisthere=0 then

			MaybeneedX=0

	End If				

	If Yisthere=0 then

			MaybeneedY=0

	End If	

	If Zisthere=0 then

			MaybeneedZ=0

	End If		

x=x+1

Wend
 

	If MaybeneedZ=1 Then

		strNeed=strNeed&";Z:\public\"

	End If

	If MaybeneedY=1 Then

		strNeed=strNeed&";Y:\bin\src\"

	End If

	If MaybeneedX=1 Then

		strNeed=strNeed&";X:\BIN\PGM\"

	End If

	If MaybeneedW=1 Then

		strNeed=strNeed&";W:\BIN\SETUP\"

	End If

	

strNeed=Join(searchpath,";")&strNeed

WSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\path", strNeed

WScript.Quit(0)

Open in new window

0
Comment
Question by:dclab
  • 2
3 Comments
 
LVL 6

Assisted Solution

by:JapyDooge
JapyDooge earned 100 total points
ID: 24390749
Hmm maybe it will work if you remap the to a local folder using subst and add that folder to the path environment variable?
0
 

Author Comment

by:dclab
ID: 24584630
Thanks for responding JapyDooge.  Not quite what I was hoping for, but I'll give it some thought.
Anyone else have some suggestions?
0
 

Accepted Solution

by:
dclab earned 0 total points
ID: 24824438
Apparently Group Policy has been extended in Windows 2008 to allow you control over many more features of the workstation.  I'm likely to go this route, in fact probably replacing the entire login script with GP settings.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now