Logon Script - Rename Mapped Drive - Windows 7 RC
Windows 7 RC Using the basic user logon script (GPO) below, maps the network location fine, but does not rename it. The drive is created with the following default name "Server (\\192.xxx.x.xxx) (X:)". FYI, The network location is a Samba share. I don't know from where windows 7 derives this default name from, but I am unable to change it at all. Even manually through windows explorer (rightclick/rename) attempting to change the drive name does not work, no matter what I change it into it reverts back to "Server (\\192.xxx.x.xxx) (X:)" after enter. No error messages. Interestingly running the rename portion of the script for a system drive (C:) works fine after the obligatory elevation prompt. BTW, script works ok in Vista/XP. Any ideas? W. Option Explicit Dim objNetwork Dim strDrive, strRemotePath, strUser, strPassword, strProfile, strName strDrive = "X:" strRemotePath = "\\192.xxx.x.xxx\Server" 'strUser = "" 'strPassword = "" strProfile = "false" strName = "Samba" Set objNetwork = CreateObject("WScript.Network") objNetwork.MapNetworkDrive strDrive, strRemotePath, strProfile Set objShell = CreateObject("Shell.Application") objShell.NameSpace(strDrive).Self.Name = strName WScript.Quit
May 12th, 2009 5:28pm

I have a similar problem - I can change the name in Explorer fine, but the vbscript fails to do so. Did you figure out what the problem was? Thanks, Matt
Free Windows Admin Tool Kit Click here and download it now
July 20th, 2009 2:13pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics