BleepingComputer.com: Server logon script (VBA) assistance

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Server logon script (VBA) assistance

#1 User is offline   philm105 

  • New Member
  • Pip
  • Find Topics
  • Group: Members
  • Posts: 9
  • Joined: 02-March 09
  • Location:California

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...

This post has been edited by philm105: 27 March 2009 - 12:22 PM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users