Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Delete and map network drive using VB script

Windows Server Help


Reply
 
Thread Tools Search this Thread
  #1  
Old 15-03-2007
Lino767
 
Posts: n/a
Delete and map network drive using VB script

I wrote the following script to delete and map network drive. What I actullay
want is to delete if the drive is mapped and map using the VP script, and
also to map the drive if the drive is not mapped. Please check this script if
it can accomplish my goal. The way the network drives were mapped is using
the bat file, now I would like to change it to VB script....Thanks

Set objNetwork = CreateObject("WScript.Network")
objnetwork.RemoveNetworkDrive "M:"
objNetwork.MapNetworkDrive "M:" , "\\Fileserv01\Test1"

Reply With Quote
  #2  
Old 16-03-2007
Marty List
 
Posts: n/a
Re: Delete and map network drive using VB script


Try the MapDrive function in the attached file.



"Lino767" <Lino767@discussions.microsoft.com> wrote in message
news:231C2206-04E5-4AF8-BA0F-505A3B5FD4E1@microsoft.com...
>I wrote the following script to delete and map network drive. What I
>actullay
> want is to delete if the drive is mapped and map using the VP script, and
> also to map the drive if the drive is not mapped. Please check this script
> if
> it can accomplish my goal. The way the network drives were mapped is using
> the bat file, now I would like to change it to VB script....Thanks
>
> Set objNetwork = CreateObject("WScript.Network")
> objnetwork.RemoveNetworkDrive "M:"
> objNetwork.MapNetworkDrive "M:" , "\\Fileserv01\Test1"


Reply With Quote
  #3  
Old 16-03-2007
Marty List
 
Posts: n/a
Re: Delete and map network drive using VB script


Sorry, I forgot to remove all the lines that start with TraceOutput, either
remove them or add some kind of debug sub-routine to the script:


Sub TraceOutput(ByVal strMessage)
'Echo or write strMessage here.
End Sub


"Marty List" <usenet@optimumx.com> wrote in message
news:7D6D019B-EB26-4491-9C65-180DDA076438@microsoft.com...
>
> Try the MapDrive function in the attached file.
>
>
>
> "Lino767" <Lino767@discussions.microsoft.com> wrote in message
> news:231C2206-04E5-4AF8-BA0F-505A3B5FD4E1@microsoft.com...
>>I wrote the following script to delete and map network drive. What I
>>actullay
>> want is to delete if the drive is mapped and map using the VP script, and
>> also to map the drive if the drive is not mapped. Please check this
>> script
>> if
>> it can accomplish my goal. The way the network drives were mapped is
>> using
>> the bat file, now I would like to change it to VB script....Thanks
>>
>> Set objNetwork = CreateObject("WScript.Network")
>> objnetwork.RemoveNetworkDrive "M:"
>> objNetwork.MapNetworkDrive "M:" , "\\Fileserv01\Test1"

>


Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Delete and map network drive using VB script"
Thread Thread Starter Forum Replies Last Post
How to delete/disconnect a network drive. Dilbert Windows Vista Network 2 04-06-2009 05:11 AM
automatic script to delete file Hardik Software Development 4 06-04-2009 10:07 PM
Logon Script to Map Network Drive based on the primary group name Jyran Active Directory 3 23-10-2008 06:58 AM
Delete files with logoff/on script Pine Le Windows Security 1 03-06-2008 11:19 PM
Need a script to delete temporary ASP.NET files Mak66 Windows Server Help 2 13-02-2008 07:00 PM


All times are GMT +5.5. The time now is 05:18 PM.