SUBSCRIBE to Windows IT Pro Magazine & SAVE 30%     Register today for your FREE 'To The Point' SharePoint eNewsletter
     
     
Skip Navigation Links.
Collapse Office and SharePointOffice and SharePoint
Collapse Newsletter ArchivesNewsletter Archives
Making Document Libraries More Accessible: Scripting Network Places and Network Locations
An Overview of SharePoint Pro Online Live!
Expand SharePoint Backup Strategies SharePoint Backup Strategies
October 16, 2007
Introducing Office and SharePoint Pro
Windows SharePoint Services and Windows Server File for Divorce
What Do You Think? New Products and Addons Forums
Use Kerberos to Secure MOSS 2007
The SharePoint Capacity Planning Tool
Service Packalooza
SharePoint News for the New Year
SharePoint Migration Secrets
SharePoint Replication
Windows Server 2008 and Windows Vista SP1: What They Mean to SharePoint
SharePoint and Forms-based Authentication
The SharePoint Permissions Model
Microsoft Online Services Offers SharePoint to Businesses of All Sizes
SharePoint: What Do YOU Think?
STSADM at Your Service
Adding Templates for Top-Level Sites
Taking the Pulse of the SharePoint Community
Big News on the Collaboration Front from Telligent
SharePoint Report Card: Search
Report from the Microsoft MVP Summit 2008
Summary of SharePoint Scenario Report Cards
Got Yahoo!? I’m so sorry.
Implementing Folder Content Types
License to Fill: Licensing Windows SharePoint Services for the Extranet
Licensing Windows SharePoint Services
News from Tech Ed, Installing WSS on Vista—a Rave and Rant, and More
Tech Ed 2008 Wrap-Up
Great Stuff
MOSS 2007 Applications in the Business World
Microsoft Online Makes a Big Splash in the Services Pool
Comparing InfoPath and SharePoint Designer Forms
Comparing InfoPath and SharePoint Designer Forms, Part 2
Migrating Microsoft Office SharePoint Server 2007 to a Different Server
Microsoft Office SharePoint Server and Excel Services
SharePoint Sharing from Beijing
Olympics Diary
SharePoint’s Role in Bringing the Games to the Web
Email-Enabling SharePoint Document Libraries and Lists
Back to Reality
SharePoint's "Big" Problems
If You Build It Right, They Will Come
Deploying Shortcuts and Favorites to SharePoint Sites
SharePointers
Easy Answers about Document Libraries (Part I): Overriding Check Out
Spiral Development, the 80/20 Rule and SharePoint
SharePoint Calendar Tips
Sharepoint Futures
Excel Services and Excel Integration with SharePoint
My Migration to Microsoft Online
SharePoint Online's Debut
A Microsoft Online Report Card
Links, Links Everywhere...
Creating a Custom Advanced Search by Building Strings with JavaScript
If Steve Ballmer Were Santa, and I Were on His Lap
MVP Predictions for 2009
Expand Office 2007Office 2007
Expand Office 2003Office 2003
Expand SharePointSharePoint
Announcements
     

     

     
     

Making Document Libraries More Accessible: Scripting Network Places and Network Locations
ToTheSharePoint Newsletter
October 30, 2007
By Dan Holme
Office & SharePoint Pro
Community Manager

Thanks for coming!

Last week, nearly 2500 of you came to SharePoint Pro Live!, our free, online conference. There, you had the opportunity to learn from some of the best and brightest SharePoint experts. Your feedback has been tremendous and we look forward to doing other such events in the near future! For those of you that attended, don't hesitate to shoot me your suggestions for the next round.

Making Document Libraries More Accessible: Scripting Network Places and Network Locations

In my session, which focused on the integration between Microsoft Office applications and SharePoint, I discussed options for making it easier for users to get to their document libraries. Expecting them to type a long URL in the File Open or File Save dialog boxes isn't realistic. I mentioned that by putting network places (Windows XP) and network locations (Windows Vista) in strategic locations, you can give users a much easier way to navigate to their libraries.

To make a long story short, network places and network locations are the same thing (Vista just had to rename them). They're the beautiful love child of a shortcut and a mapped drive. They're born in the My Network Places folder (XP) or in the Computer folder (Vista), but they can be moved anywhere, like a shortcut. Also like a shortcut, they can have descriptive, friendly names. Like a mapped drive, they appear as a folder in the Windows Explorer folder tree, allowing users to expand their contents.


Network places/locations are, in my opinion, one of the most useful UI elements in existence--and one of the most underutilized. Create network places/locations not just to SharePoint document libraries, but also to regular shared folders needed by users. I suggest putting network places/locations to commonly used targets on the desktop, and then putting other network places/locations in the My Network Places or Computer folder. But you can put them anywhere--even in users' (My) Documents folder or in the root of their user profile (which is great for Vista).

Here's what I recommend:

1. Determine which network folders (SharePoint document libraries and shared folders) are accessed by a user.
2. Create network places/locations that target those folders.
  • Create network places on XP in the My Network Places folder.
  • Create network locations in Vista by opening Computer, right-clicking in an empty area, and choosing Add A Network Location.
  • For SharePoint document libraries, the "target" should be the UNC to the document library, in the form \\ server \ site \[ subsite \]library, or the URL, in the form http:// server / site /[ subsite /] library . Experiment to determine what works best for your clients--there are differences between Vista and XP in how they respond to library addresses. The actual location where the network places/locations are created is the Nethood folder: %userprofile%\Nethood in XP, or in Vista %userprofile%\AppData\Roaming\Microsoft\Windows\Network Shortcuts.
  • Network places/locations in the Nethood folder are shown in the My Network Places folder in XP. In Vista, the network locations appear in two places: in the Network Locations group in the Computer folder and in the Network Shortcuts folder.
3. Organize the network places/locations to make them easily accessible.
  • You might choose to put the most commonly used network places/locations on the desktop, in the [My] Documents folder or (on Vista) in the root of the user's profile, which can be accessed by clicking the user name in the Start menu.
  • Less commonly used network places can be left in the Nethood folder.
  • When a user chooses the Open or Save command, Office 2003 & Office 2007 start a user in the last folder they were accessing, or in the (My) Documents folder. A user can click My Network Places if they're running XP or Desktop (or Computer) if they're running Vista and, from there, it's one more click to the document library if you've placed their network places/locations there. Interestingly, Network Shortcuts is not in the "links" by default on a Vista client. You can resolve this by adding a shortcut to the Nethood folder into the user's Links folder.
  • When an Office 2007 user chooses the Publish to Document Management Server command, the dialog box that appears is focused on the My Network Places (XP) or Network Shortcuts folder (Vista). The "Desktop" folder is one click away in the dialog box. That would suggest that the Nethood folder or the Desktop would be good places for network places/locations.

4. Disable XP's default behavior to automatically create network places. XP had an annoying habit of adding network places automatically, which fills up the Network Places folder with junk, and (I think) was one of the reasons why a lot of enterprises never took advantage of this great feature. To disable the automatic creation of network places, use Group Policy settings: User Configuration \ Administrative Templates \ Desktop \ Do not add shares of recently opened documents to My Network Places.

Finally, a number of users asked if it's possible to script the creation of network places/locations to speed deployment and management of network places. The answer is, "Yes!" The script follows at the end of this newsletter.

Until next time, happy SharePointing!


Dan Holme
dan h [at] (intelliem dot toplevel commercial domain)


' Create a network place (XP) or network location (Vista)

Option Explicit

' Generic objects - can be moved to global part of script

Dim WSHShell, FSO

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

Set FSO = CreateObject("Scripting.FileSystemObject")

Dim sFolderPath, sTargetPath

' Create the network places - THIS IS THE ONLY BLOCK OF THE SCRIPT THAT YOU SHOULD NEED TO CHANGE

' Example A: a document library network place/location created in the Nethood folder

sFolderPath = WSHShell.SpecialFolders("NetHood") & "\" & "Expense Reports Document Library"

sTargetPath = "\\sharepoint.contoso.com\finance\expensereports"

CreateNetworkPlace sFolderPath, sTargetPath

sFolderPath = WSHShell.SpecialFolders("Desktop") & "\" & "Departmental Shared Folder"

sTargetPath = "\\server01\data$\departments\finance"

CreateNetworkPlace sFolderPath, sTargetPath

' This routine will create a network place

' which is actually a read only folder

' containing a regular shortcut named target.lnk and

' a desktop.ini file with specific contents

Sub CreateNetworkPlace(sFolderPath, sTargetPath)

Dim oTextFile, oFolder, oShortcut

' Create the folder and make it read only (required for Network Place)

If FSO.FolderExists(sFolderPath) Then

FSO.DeleteFolder sFolderPath, True

End If

' Create the folder

Set oFolder = FSO.CreateFolder(sFolderPath)

' Read-only attribute

oFolder.Attributes = 1

' Create the shortcut to the target inside the folder

Set oShortcut = WSHShell.CreateShortcut(oFolder.Path & "\target.lnk")

oShortcut.TargetPath = sTargetPath

oShortcut.Save

' Create the Desktop.ini file which makes it a Network Place and assigns the icon

Set oTextFile = oFolder.CreateTextFile("Desktop.ini", True)

oTextFile.WriteLine "[.ShellClassInfo]"

oTextFile.WriteLine "CLSID2={0AFACED1-E828-11D1-9187-B532F1E9575D}"

oTextFile.WriteLine "Flags=2"

oTextFile.WriteLine "ConfirmFileOp=0"

' 1 displays a warning that this is a system folder when moving, deleting, renaming a system folder

' 0 avoids the warnings

oTextFile.Close

End Sub
© Copyright 2007 MSD2D / A Penton Media, Inc. Company
MSD2D a division of Penton Media, Inc.
1300 E. 9th Street
Cleveland, OH 44114