For Programmers: Free Programming Magazines  


Home > Archive > C# > January 2006 > Change networkdrive name









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Change networkdrive name
googhum

2006-01-13, 9:15 am

I would like to change the name of some networkdrives. A smalle VB script does the trick:

code:
sDrive = "G:\" Set oShell = CreateObject("Shell.Application") oShell.NameSpace(sDrive).Self.Name = "Some description here"

Now i would like to use C#:
code:
Type type = Type.GetTypeFromProgID("Shell.Application"); Object objShell = Activator.CreateInstance(type); objShell.NameSpace("E:\\").Self.Name = "test";

,but this doesn't work. Any suggestions?
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com