troubleshooting Question

Server 2000 Logon Script question

Avatar of mrjking2000
mrjking2000 asked on
Windows 2000
2 Comments1 Solution271 ViewsLast Modified:
I have a question for the group which I know is easily answered if you understand VBS scripts.  I found a script on EE here about a year ago that maps user drives and I found out how to add printers to the script as well...but each day the users log onto the machines they get two messages saying "user folders exists" and then " 'name' folder exists."

Here is the script,
====================================================
Dim objNetwork, objFSO
Dim strDriveLetter, strUNCPath, strUser

On Error Resume Next

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objNetwork= CreateObject("Wscript.Network")
strUser =objNetwork.UserName
strUNCPath = "\\harley\user folders"

if objFSO.FolderExists(strUNCPath) then
  WScript.Echo strUNCPath & " exists!"
  if objFSO.FolderExists(strUNCPath & "\" & strUser) then
    WScript.Echo strUNCPath & "\" & strUser & " exists!"
  else
    objFSO.CreateFolder(strUNCPath & "\" & strUser)
  end if
end if

strDriveLetter = "P:"
objNetwork.RemoveNetworkDrive strDriveLetter, True
objNetwork.MapNetworkDrive strDriveLetter,strUNCPath & "\" & strUser
WScript.Quit
===================================================

I know the messages are coming from this point below, but I have tried editing this and the script doesn't execute properly.

if objFSO.FolderExists(strUNCPath) then
  WScript.Echo strUNCPath & " exists!"
  if objFSO.FolderExists(strUNCPath & "\" & strUser) then
    WScript.Echo strUNCPath & "\" & strUser & " exists!"
  else
    objFSO.CreateFolder(strUNCPath & "\" & strUser)
  end if
end if


What do I need to do to make the messages stop popping up, the end users are finding this very annoying to click "ok" twice each morning.

Thanks!
--Justin
ASKER CERTIFIED SOLUTION
ryangorman

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros