tags:

views:

16

answers:

1

Hi -I have this script to automatically map network drives:

On Error Resume Next
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "M:" , "\\devel\fs"

After I restart the computer, I lose the mappings. How can I fix it?

Thank you very much.

+3  A: 

Option 1: Put the script in the "startup" folder so it runs automatically when the PC is rebooted.

Option 2: Set the value of the optional parameter named 'bUpdateProfile" to true, so that the mapping will persist with the user. (This is how it is in Windows anyway. If I log onto a PC, the mapped drives/printers, etc may be different than if you log on to it.)

See this article for an explanation of the bUpdateProfile parameter (as well as usage of the MapNetworkDrive function in general):

http://msdn.microsoft.com/en-us/library/8kst88h6(VS.85).aspx

David Stratton
Hi David thank you very much.
Bruno Ligutti