Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Server logon script (VBA) assistance


  • Please log in to reply
No replies to this topic

#1 philm105

philm105

  • Members
  • 9 posts
  • OFFLINE
  •  
  • Location:California
  • Local time:09:52 AM

Posted 27 March 2009 - 12:22 PM

Looking for some guideance on checking if a directory exists or not in my logon script to my server. I am using the following code but want to test if the directory does not exist then delete the mapping for the user's drive (or not map it at all):

WSHNetwork.MapNetworkDrive "J:", "\\server\users\" & UserString

Some users do not have this directory setup so I do nto want to map it. I have tried an idea to use an "If" statement but I am not getting the code correct:

If WSHNetwork.MapNetworkDrive "J:", "\\\server\users\" & UserString = False Then
WSHNetwork.RemoveNetworkDrive "J:"
Else WSHNetwork.MapNetworkDrive "J:", "\\server\users\" & UserString
End if

I am new to VBA so bear with me if this is too simple. :thumbsup: I would appreacite any suggestions...Thanks...

Edited by philm105, 27 March 2009 - 12:22 PM.


BC AdBot (Login to Remove)

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users