john15nlt
asked on
sharepoint network shortcut
Please read all of this before you respond.
I have a sharepoint site that I need to create a network share and I need it to have a clean appearance.
What I want I can not seem to have, if I create a network shortcut from the gui in windows 7, explorer, computer, map network drive, select "connect to a Web site ..." what I get is a very clean looking shortcut under the mapped drive letters with very clean names.
I need to either be able to do this task 1. from a command prompt 2. from a vbs script 3. by a manual manipulation of the registry.
I can create a folder using net use but what I get is not a clean share, this is not about me this is about my user community that does not like change, and will not like shares with dirty names, it just confuses them.
Can anyone help
I have a sharepoint site that I need to create a network share and I need it to have a clean appearance.
What I want I can not seem to have, if I create a network shortcut from the gui in windows 7, explorer, computer, map network drive, select "connect to a Web site ..." what I get is a very clean looking shortcut under the mapped drive letters with very clean names.
I need to either be able to do this task 1. from a command prompt 2. from a vbs script 3. by a manual manipulation of the registry.
I can create a folder using net use but what I get is not a clean share, this is not about me this is about my user community that does not like change, and will not like shares with dirty names, it just confuses them.
Can anyone help
ASKER
Hi John,
You post is somewhat confusing.
The folder that you see is in fact a shortcut, not a network location.
The network shortcuts are stored at:
C:\users\{username}\AppDat a\Roaming\ Microsoft\ Windows\Ne twork Shortcuts\{Location}\targe t.lnk
C:\users\{username}\AppDat a\Roaming\ Microsoft\ Windows\Ne twork Shortcuts\{Location}\deskt op.ini
You can programmically create them using vbs. I didnt test it, but this might do the job:
http://ss64.com/vb/shortcut.html
http://community.spiceworks.com/scripts/show/229-add-shares-to-my-network-places
A quick glance at the script makes me wonder if the path / pathtrees are right. But those are easly altered.
You post is somewhat confusing.
The folder that you see is in fact a shortcut, not a network location.
The network shortcuts are stored at:
C:\users\{username}\AppDat
C:\users\{username}\AppDat
You can programmically create them using vbs. I didnt test it, but this might do the job:
http://ss64.com/vb/shortcut.html
http://community.spiceworks.com/scripts/show/229-add-shares-to-my-network-places
A quick glance at the script makes me wonder if the path / pathtrees are right. But those are easly altered.
ASKER
Ok now we are getting somewhere.. the scripts are close but are pretty much what I have already been dealing with they create a shortcut in C:\users\{username}\AppDat a\Roaming\ Microsoft\ Windows\Ne twork Shortcuts\ however when you create this link via the gui it creates a directory and then the link is inside that folder.
I was able to modify the script to get it to create a folder and the link inside that folder, however instead of opening that link in explorer (which is what I am after) it opens a browser.. notice also the links are not the same.
Set WSHShell = CreateObject("WScript.Shel l")
Dim oFSO
Set oFSO = CreateObject("Scripting.Fi leSystemOb ject")
Const NETHOOD = &H13&
Set objWSHShell = CreateObject("Wscript.Shel l")
Set objShell = CreateObject("Shell.Applic ation")
Set objFolder = objShell.Namespace(NETHOOD )
Set objFolderItem = objFolder.Self
strNetHood = objFolderItem.Path
strPath = objFolderItem.Path & "\*.*"
On Error Resume Next
objFSO.DeleteFile strPath, true
strShortcutName = "NewShare"
strShortcutPath = "https://XXXXXX/users"
strNetHood = strNetHood & "\" & strShortcutName
wscript.echo strNetHood
oFSO.CreateFolder strNetHood
Set objShortcut = objWSHShell.CreateShortcut _
(strNetHood & "\target.lnk")
objShortcut.TargetPath = strShortcutPath
objShortcut.Save
WSCript.Quit
Any thoughts?
networkshares.JPG
I was able to modify the script to get it to create a folder and the link inside that folder, however instead of opening that link in explorer (which is what I am after) it opens a browser.. notice also the links are not the same.
Set WSHShell = CreateObject("WScript.Shel
Dim oFSO
Set oFSO = CreateObject("Scripting.Fi
Const NETHOOD = &H13&
Set objWSHShell = CreateObject("Wscript.Shel
Set objShell = CreateObject("Shell.Applic
Set objFolder = objShell.Namespace(NETHOOD
Set objFolderItem = objFolder.Self
strNetHood = objFolderItem.Path
strPath = objFolderItem.Path & "\*.*"
On Error Resume Next
objFSO.DeleteFile strPath, true
strShortcutName = "NewShare"
strShortcutPath = "https://XXXXXX/users"
strNetHood = strNetHood & "\" & strShortcutName
wscript.echo strNetHood
oFSO.CreateFolder strNetHood
Set objShortcut = objWSHShell.CreateShortcut
(strNetHood & "\target.lnk")
objShortcut.TargetPath = strShortcutPath
objShortcut.Save
WSCript.Quit
Any thoughts?
networkshares.JPG
Hi John,
Give me a few moments.
I will see if i can script something for you.
This might take a short while because i need to finish something else first.
I hope you dont mind ;-)
Give me a few moments.
I will see if i can script something for you.
This might take a short while because i need to finish something else first.
I hope you dont mind ;-)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just tested it.
It opens up an explorer window like expected.
It opens up an explorer window like expected.
ASKER
Great job thanks,
ASKER
This is a followup, this works on windows 7 without a hitch. It will also create the shares in windows xp without a problem. the issue is that in windows xp they will not work. I am not sure where the breakdown is (some where in the windows web services api) or somewhere else.
If someone could help me navigate this issue that would be great.
If someone could help me navigate this issue that would be great.
webdav is required. im not sure windows xp its explorer proces supports webdav without additional config.
rgrds Chris
rgrds Chris
webdav is required. im not sure windows xp its explorer proces supports webdav without additional config.
rgrds Chris
rgrds Chris
What does 'clean' mean in this context? could you please elaborate on this?
rgrds,