Bug in MapNetworkDrive Method? 
Author Message
 Bug in MapNetworkDrive Method?

Hi,

I'm attempting to map using the "no local name" method described in the MS
Programmer's Reference below.  It works great when supplied a local name
(drive letter) but returns wrong number of arguments with just the remote
share or just the share and user credentials (WSH 2.0 beta).   Any ideas
would really be appreciated.

Thanks

Example
Set WshNetwork = Wscript.CreateObject("Wscript.Network")
' Local name mapped to remote share
WshNetwork.MapNetworkDrive "Z:", "\\Server\Share"
WshNetwork.RemoveNetworkDrive "Z:"
' No local name mapping, such as:
' NET USE \\Server\ShareWshNetwork.RemoveNetworkDrive "\\Server\Share"
WshNetwork.MapNetworkDrive "\\Server\Share"
WshNetwork.RemoveNetworkDrive "\\Server\Share"



Tue, 05 Feb 2002 03:00:00 GMT  
 Bug in MapNetworkDrive Method?
The docs don't indicate that the first argument is optional:

object.MapNetworkDrive strLocalName, strRemoteName, [bUpdateProfile],
[strUser], [strPassword]

Where did you find an example that indicates that it is optional?

Have you tried passing a null string?

--
Michael Harris


| Hi,
|
| I'm attempting to map using the "no local name" method described in the MS
| Programmer's Reference below.  It works great when supplied a local name
| (drive letter) but returns wrong number of arguments with just the remote
| share or just the share and user credentials (WSH 2.0 beta).   Any ideas
| would really be appreciated.
|
| Thanks
|
| Example
| Set WshNetwork = Wscript.CreateObject("Wscript.Network")
| ' Local name mapped to remote share
| WshNetwork.MapNetworkDrive "Z:", "\\Server\Share"
| WshNetwork.RemoveNetworkDrive "Z:"
| ' No local name mapping, such as:
| ' NET USE \\Server\ShareWshNetwork.RemoveNetworkDrive "\\Server\Share"
| WshNetwork.MapNetworkDrive "\\Server\Share"
| WshNetwork.RemoveNetworkDrive "\\Server\Share"
|
|
|



Tue, 05 Feb 2002 03:00:00 GMT  
 Bug in MapNetworkDrive Method?
Thanks Michael, the null string did the trick.  Works perfect now.

True, they don't explicitly indicate the argument is optional, but they
reference the method in both the Example and the strName parameter of
RemoveNetworkDrive in the 1.0 docs.

http://msdn.microsoft.com/scripting/windowshost/docs/reference/object...
tm

strName

The strName parameter can be either a local name or a remote name, depending
on how the drive is mapped. If the drive has a mapping between a local name
(drive letter) and a remote name, then strName must be set to the local
name. If the network path does not have a local name (drive letter) mapping,
then strName must be set to the remote name.


Quote:
> The docs don't indicate that the first argument is optional:

> object.MapNetworkDrive strLocalName, strRemoteName, [bUpdateProfile],
> [strUser], [strPassword]

> Where did you find an example that indicates that it is optional?

> Have you tried passing a null string?

> --
> Michael Harris



> | Hi,
> |
> | I'm attempting to map using the "no local name" method described in the
MS
> | Programmer's Reference below.  It works great when supplied a local name
> | (drive letter) but returns wrong number of arguments with just the
remote
> | share or just the share and user credentials (WSH 2.0 beta).   Any ideas
> | would really be appreciated.
> |
> | Thanks
> |
> | Example
> | Set WshNetwork = Wscript.CreateObject("Wscript.Network")
> | ' Local name mapped to remote share
> | WshNetwork.MapNetworkDrive "Z:", "\\Server\Share"
> | WshNetwork.RemoveNetworkDrive "Z:"
> | ' No local name mapping, such as:
> | ' NET USE \\Server\ShareWshNetwork.RemoveNetworkDrive "\\Server\Share"
> | WshNetwork.MapNetworkDrive "\\Server\Share"
> | WshNetwork.RemoveNetworkDrive "\\Server\Share"
> |
> |
> |



Wed, 06 Feb 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Make a test with mapnetworkdrive method

2. search method has bugs!

3. TextStream.Write method bug?

4. Known bug with Session_OnEnd method in Global.asa file

5. Bug in TransferSpreadsheet method?

6. Bug: The run method

7. BUG: Problem using the Restrict method in Office 2000 VBA code

8. Bugs in Registry Access methods ?

9. Is it a BUG with Run method of WScript.Shell

10. BUG: Memory Leak in JScript toString and toLocaleString Methods

11. MapNetworkDrive Error

12. Bug in Remote Scripting Caused by Javascript bug?

 

 
Powered by phpBB® Forum Software