Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Programmatically create a New Network Location link Windows 7 Expand / Collapse
Author
Message
Posted Wednesday, May 14, 2014 8:26 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, December 19, 2014 6:34 AM
Points: 439, Visits: 1,015
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?




Post #1570869
Posted Thursday, May 15, 2014 11:58 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, December 19, 2014 6:34 AM
Points: 439, Visits: 1,015
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.




Post #1571459
Posted Friday, May 16, 2014 6:05 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 4:11 AM
Points: 5,825, Visits: 3,742
Thanks for posting the solution to your own problem. Very generous. Much appreciated.

Gaz

-- Stop your grinnin' and drop your linen...they're everywhere!!!
Post #1571678
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse