Avatar of mrjking2000
mrjking2000
 asked on

Server 2000 Logon Script question

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
Windows 2000

Avatar of undefined
Last Comment
mrjking2000

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
ryangorman

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
mrjking2000

ASKER
That did the trick, thanks ryangorman.

kinda like a dos script, rem voids out a line...now I know that ' voids out a VBS line.

Many Thanks!
--Justin
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck