Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Programmatically create a New Network Location link Windows 7


Programmatically create a New Network Location link Windows 7

Author
Message
schleep
schleep
Mr or Mrs. 500
Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)

Group: General Forum Members
Points: 520 Visits: 1287
Still trying to programmatically create a New Network Location link.

I've got it down to -- I think:

$Newlink = New-Object System.IO.DirectoryInfo "$MyPath"

But I can't figure out how to set the target, which is a \\Server\Drive$

Any ideas?



schleep
schleep
Mr or Mrs. 500
Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)

Group: General Forum Members
Points: 520 Visits: 1287
Well it took some looking, but I found out to do it. With a couple of minor mods , it works!!

The gotcha is that a File Folder link is an internal MS type,
"CLSID2={0AFACED1-E828-11D1-9187-B532F1E9575D}"
which is NOT the simplest thing to work with (for this DBA, at least :-)).

See http://social.technet.microsoft.com/Forums/scriptcenter/en-US/bd00d576-6096-4c8d-bd82-3c5853eb6675/create-shortcut-in-my-network-places-using-powershell?forum=ITCG&prof=required

First post in the answers, by Aakash Shah.



Gary Varga
Gary Varga
SSCrazy Eights
SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)

Group: General Forum Members
Points: 8260 Visits: 6129
Thanks for posting the solution to your own problem. Very generous. Much appreciated.

Gaz

-- Stop your grinnin' and drop your linen...they're everywhere!!!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search