Permanently Map Network Drive 
Author Message
 Permanently Map Network Drive

Is there a way to permanently map a network drive through VBScript?  I have
used the following:

Set WshNetwork = CreateObject("Wscript.Network")
WshNetwork.MapNetworkDrive Drive, "\\" & FileServer & "\" & Share

But this only lasts as long as you are logged on to the machine.  I want to
use VBScript to accomplish this.  Thanks.



Sat, 02 Jul 2005 03:38:29 GMT  
 Permanently Map Network Drive

Quote:

> Is there a way to permanently map a network drive through VBScript?  I have
> used the following:

> Set WshNetwork = CreateObject("Wscript.Network")
> WshNetwork.MapNetworkDrive Drive, "\\" & FileServer & "\" & Share

> But this only lasts as long as you are logged on to the machine.  I want to
> use VBScript to accomplish this.  Thanks.

Hi

Set the argument bUpdateProfile in the MapNetworkDrive method to True.

WSH\VBScript/Jscript 5.6 documentation download (script56.chm)
http://msdn.microsoft.com/downloads/sample.asp?url=/MSDN-FILES/027/00...

--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and a ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter



Sat, 02 Jul 2005 04:31:01 GMT  
 Permanently Map Network Drive
Thanks.  The answer was right in front of me, I just needed some help.


Quote:

> > Is there a way to permanently map a network drive through VBScript?  I
have
> > used the following:

> > Set WshNetwork = CreateObject("Wscript.Network")
> > WshNetwork.MapNetworkDrive Drive, "\\" & FileServer & "\" & Share

> > But this only lasts as long as you are logged on to the machine.  I want
to
> > use VBScript to accomplish this.  Thanks.

> Hi

> Set the argument bUpdateProfile in the MapNetworkDrive method to True.

> WSH\VBScript/Jscript 5.6 documentation download (script56.chm)

http://msdn.microsoft.com/downloads/sample.asp?url=/MSDN-FILES/027/00...
sdncompositedoc.xml

- Show quoted text -

Quote:

> --
> torgeir
> Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and a ONLINE version of the 1328 page
> Scripting Guide: http://www.microsoft.com/technet/scriptcenter



Sat, 02 Jul 2005 05:53:31 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. get drive size from network network mapped drives

2. Mapping Drives Permanently

3. rename a drive / map network drive

4. Network Drive mapping?

5. mapping a network drive

6. map network drive & getFile

7. Mapping a network drive

8. Mapping Network Drives

9. If member of a group then map network drive

10. Mapping and removing Network Drives using VB

11. Map a Network Drive

12. Change Mapped Network Drive

 

 
Powered by phpBB® Forum Software