|
Hello,
I used this script , but it maps without the correct label. What can be wrong ?
Function MapDrive($DriveLetter, $UNC, optional $Label, optional $Icon, optional $Delete, optional $persistent) dim $subcmd,
$pt, $d, $di, $shell, $per $d = left($DriveLetter,1) $di=
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons" $pt= @producttype if $pt =
"Windows NT Workstation" $subcmd="subst" $per='' else $subcmd="net use"
if $persistent $per='/PERSISTENT ' endif endif if $delete shell '%comspec% /c
$subcmd $d: /d $per 1>Nul 2>&1' $=deltree("$di\$D") endif shell '%comspec% /c $subcmd $D: "$UNC" $per
1>Nul 2>&1' if not exist('$D:\') exit 1 return endif if $pt="Windows XP
Professional" or $pt="Windows 2000 Professional" if $Label
$shell=createobject("shell.application") $shell.namespace('$D:\').self.name=$Label
endif if $icon $=writevalue('$di\$D\DefaultIcon','','$Icon',REG_SZ) endif
endif ENDFUNCTION
MapDrive("x","\\server1\general","Test share","C:\WINNT\system32\moricons.dll,21",1)
|