Avatar of compdigit44
compdigit44
 asked on

VBSCript and %userprofile% - File NOt found

I am try to write a script that will drop a log file at the root of the user's profile using %userprofile%

I searched online on how to do this but still no luck.

 What is the proper syntax I need to reference %userprofile% and drop a file with a predefined name in this location.
VB Script

Avatar of undefined
Last Comment
Joe Howard

8/22/2022 - Mon
Joe Howard

Not sure what you mean by "drop a file". This will give you the user profile folder:
Set ws = WScript.CreateObject("WScript.Shell")
strUserProfile = ws.ExpandEnvironmentStrings("%userprofile%")

Open in new window

compdigit44

ASKER
I mean the log file created has to be placed in the %userprofile% directory.

When I call the file in the script using strprofile\file.txt I get file not found
Joe Howard

Do you want to copy the log file or move it? What is the source path?
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
compdigit44

ASKER
I need to create a new log file in this location
Joe Howard

Try this:
Dim oWsh, strUserProfile , oFSO, oFile

Set oWsh = WScript.CreateObject("WScript.Shell")
strUserProfile = ws.ExpandEnvironmentStrings("%userprofile%")
Set oFSO= CreateObject("Scripting.FileSystemObject")
Set oFile= oFSO.CreateTextFile("strUserProfile\file.txt")

Open in new window

compdigit44

ASKER
I get the error in line one:  "object required: 'ws'
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Joe Howard

Use the new code instead of the old one.
compdigit44

ASKER
I am it errors on line 4

strUserProfile = ws.ExpandEnvironmentStrings("%userprofile%")

Object required 'WS'
Joe Howard

I'm so sorry, should be:
strUserProfile = oWsh.ExpandEnvironmentStrings("%userprofile%")

Open in new window

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
compdigit44

ASKER
Thanks!!!

I we are makin progess.. I keep getting path not found though.

Here is my line to insert the log file...

Set objLogFile = objFSO.OpenTextFile("oFile", 8, True, 0)
Joe Howard

Now I'm confused, the code I posted creates a text file (file.txt) in the user profile. Isn't that what you want?
compdigit44

ASKER
No I think  I am confused since  I not not a scripting person. Below is sample from my scirpt so far...
Dim oWsh, strUserProfile , oFSO, oFile

Set oWsh = WScript.CreateObject("WScript.Shell")
strUserProfile = oWsh.ExpandEnvironmentStrings("%userprofile%")
Set oFSO= CreateObject("Scripting.FileSystemObject")
Set oFile= oFSO.CreateTextFile("strUserProfile\file.txt")



Function LogEntry (LogEntryText)
      objLogFile.WriteLine "<![LOG[" & LogEntryText & "]LOG]!><time=""" & Hour(Now) & ":" & Minute(Now) & ":" & Second(Now) & ".001+240"" date=""" & Replace(Date(), "/", "-") & """ component=""PrintMapDelete"" context="""" type=""1"" thread=""0"" file=""" & WScript.Application & " " & WScript.Version & """>"
End Function
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objLogFile = objFSO.OpenTextFile(oFile, 8, True, 0)

Why is my Set objLogFile = objFSO.OpenTextFile(oFile, 8, True, 0) line not working
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
compdigit44

ASKER
What is going wrong ??????
Joe Howard

Try this:
Dim oWsh, strUserProfile, oFSO, oFile

Call LogEntry("TEST")

Function LogEntry(LogEntryText)
    Set oWsh = WScript.CreateObject("WScript.Shell")
    strUserProfile = oWsh.ExpandEnvironmentStrings("%userprofile%")
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    Set oFile = oFSO.OpenTextFile(strUserProfile & "\file.txt", 8, True, 0)
    oFile.WriteLine "<![LOG[" & LogEntryText & "]LOG]!><time=""" & Hour(Now) & ":" & Minute(Now) & ":" & Second(Now) & ".001+240"" date=""" & Replace(Date, "/", "-") & """ component=""PrintMapDelete"" context="""" type=""1"" thread=""0"" file=""" & WScript.Application & " " & WScript.Version & """>"
End Function

Open in new window

compdigit44

ASKER
Still having problems ...

Below is a sample of my script.

Dim oWsh, strUserProfile, oFSO, oFile

Call LogEntry("LogEntryText")

Function LogEntry(LogEntryText)
    Set oWsh = WScript.CreateObject("WScript.Shell")
    strUserProfile = oWsh.ExpandEnvironmentStrings("%userprofile%")
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    Set oFile = oFSO.CreateTextFile(strUserProfile & "\file.txt")
    Set oFile = oFSO.OpenTextFile(strUserProfile & "\file.txt", 8, 0)
    oFile.WriteLine "<![LOG[" & LogEntryText & "]LOG]!><time=""" & Hour(Now) & ":" & Minute(Now) & ":" & Second(Now) & ".001+240"" date=""" & Replace(Date, "/", "-") & """ component=""PrintMapDelete"" context="""" type=""1"" thread=""0"" file="""    '& WScript.Application & " " & WScript.Version & """>"
End Function



Set WshNetwork = WScript.CreateObject("WScript.Network")
Set colPrinters = WshNetwork.EnumPrinterConnections
For intPrinter = 0 To colPrinters.Count - 1 Step 2
      strPrinterPort = colPrinters(intPrinter)
      strPrinterName = colPrinters(intPrinter + 1)
      LogEntry strPrinterName & " - " & strPrinterPort

      If left(colPrinters.Item(intPrinter + 1),len(strSrvName1)) = strSrvName1 Then
            LogEntry "      Printer matches target name.  Printer will be deleted"
            On Error Resume Next
            WshNetwork.RemovePrinterConnection strPrinterName
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Joe Howard

What is the problem and where does it occur?
compdigit44

ASKER
line 10 char 5 file not found...
compdigit44

ASKER
I am sorry one of my co-workers was helping me write then left for vacation
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
compdigit44

ASKER
Disregard my post about my error it was a typo. New error is permision denied for %userprofile%
Joe Howard

Try this:
Dim oWsh, strUserProfile , oFSO, oFile

Call LogEntry("TEST")

Function LogEntry (LogEntryText)
     Set oWsh = WScript.CreateObject("WScript.Shell")
     strUserProfile = oWsh.ExpandEnvironmentStrings("%userprofile%")
     Set oFSO = CreateObject("Scripting.FileSystemObject")
     Set oFile = oFSO.CreateTextFile(strUserProfile & "\file.txt")
     oFile.Close
     Set oFile = oFSO.OpenTextFile(strUserProfile & "\file.txt", 8, True, 0)
     oFile.WriteLine "<![LOG[" & LogEntryText & "]LOG]!><time=""" & Hour(Now) & ":" & Minute(Now) & ":" & Second(Now) & ".001+240"" date=""" & Replace(Date(), "/", "-") & """ component=""PrintMapDelete"" context="""" type=""1"" thread=""0"" file=""" & WScript.Application & " " & WScript.Version & """>"
End Function

Open in new window

compdigit44

ASKER
Thanks this seems to be working, although I do not understand something.

In lines 9 & 11 if I rename the file.txt I get a Permission Denied message. Yet it works fine with file.txt

From what I am finding online it seems to be caused by the fact the file could already be open or present. Yet, I have set the file write to append and we are already closing the connection before reading it.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
compdigit44

ASKER
I have confirm the script is creating the file in the correct location but nothing is getting written to it. The script is close the file after creating it so I am at a loss as to the problem
ploftin

The top portion of your script should look as follows:

Dim oWsh, strUserProfile, oFSO, oFile, strFile

 Call LogEntry("LogEntryText")

 Function LogEntry(LogEntryText)
     Set oWsh = WScript.CreateObject("WScript.Shell")
     strUserProfile = oWsh.ExpandEnvironmentStrings("%userprofile%")
     strFile = strUserProfile & "\file.txt"
     Set oFSO = CreateObject("Scripting.FileSystemObject")
     If Not oFSO.FileExists(strFile) Then
         oFSO.CreateTextFile strFile
     End If
     Set oFile = oFSO.OpenTextFile(strFile, 8, 0)
     oFile.WriteLine "<![LOG[" & LogEntryText & "]LOG]!><time=""" & Hour(Now) & ":" & Minute(Now) & ":" & Second(Now) & ".001+240"" date=""" & Replace(Date, "/", "-") & """ component=""PrintMapDelete"" context="""" type=""1"" thread=""0"" file="""    '& WScript.Application & " " & WScript.Version & """>"
 End Function

Open in new window


The problem is you're assigning oFile when you're creating the file and then you're trying to assign it again when you're opening it for appending.
compdigit44

ASKER
I got the same error again using the code you suggested... :o(
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ploftin

How are you executing the script?  Are you double-clicking it, running it from a command prompt using 'cscript scriptname.vbs' or are you assigning this as a startup script that runs when the computer boots?
compdigit44

ASKER
For testing purposes I am double clicking the script from my desktop but plan on deploying it via a group policy login script
compdigit44

ASKER
I just tried to run it using cscript from the command line and got the same permission denined error
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
compdigit44

ASKER
the script is creating the file but not able to write to it after it is created
compdigit44

ASKER
I have read online this has nothing to do with a permission problem persay but have to do with the fact the CreateTextFile method is beging used and is failing on the opentextfile method becusae the file is already open.

The suggestion has been to write to the reference instead.. Does anyone know what they are referring to?
http://stackoverflow.com/questions/369242/vbscript-fso-opentextfile-permission-denied
ploftin

The reference is correct.  If you create the text file and leave it open, such as:

Set objFile = objFSO.CreateTextFile(strFile)

Open in new window


Then objFile has the file locked.  However, in the code I'm proposing, we're creating the text file with:

oFSO.CreateTextFile strFile

Open in new window


And this does not leave the file open.  If you're using the block of text below, exactly as I have it, it should run with no issues.  I've written to the log file several times with no issues.  I can run it over and over and it appends properly.

Dim oWsh, strUserProfile, oFSO, oFile, strFile

 Call LogEntry("LogEntryText")

 Function LogEntry(LogEntryText)
     Set oWsh = WScript.CreateObject("WScript.Shell")
     strUserProfile = oWsh.ExpandEnvironmentStrings("%userprofile%")
     strFile = strUserProfile & "\file.txt"
     Set oFSO = CreateObject("Scripting.FileSystemObject")
     If Not oFSO.FileExists(strFile) Then
         oFSO.CreateTextFile strFile
     End If
     Set oFile = oFSO.OpenTextFile(strFile, 8, 0)
     oFile.WriteLine "<![LOG[" & LogEntryText & "]LOG]!><time=""" & Hour(Now) & ":" & Minute(Now) & ":" & Second(Now) & ".001+240"" date=""" & Replace(Date, "/", "-") & """ component=""PrintMapDelete"" context="""" type=""1"" thread=""0"" file="""    '& WScript.Application & " " & WScript.Version & """>"
 End Function

Open in new window


Try just that code snippet in a vbs file all by itself and see if it works - it should.  Perhaps you're experiencing another issue that we're not seeing the code for.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
compdigit44

ASKER
Thanks for the reply I am using the exact code of posted earlier and getting the same permission denied at line 13 which is:    

Set oFile = oFSO.OpenTextFile(strFile, 8, 0)
compdigit44

ASKER
Here is my code....
Dim oWsh, strUserProfile, oFSO, oFile, strFile

 Call LogEntry("LogEntryText")

 Function LogEntry(LogEntryText)
     Set oWsh = WScript.CreateObject("WScript.Shell")
     strUserProfile = oWsh.ExpandEnvironmentStrings("%userprofile%")
     strFile = strUserProfile & "\file.txt"
     Set oFSO = CreateObject("Scripting.FileSystemObject")
     If Not oFSO.FileExists(strFile) Then
         oFSO.CreateTextFile strFile
     End If
     Set oFile = oFSO.OpenTextFile(strFile, 8, 0)
     oFile.WriteLine "<![LOG[" & LogEntryText & "]LOG]!><time=""" & Hour(Now) & ":" & Minute(Now) & ":" & Second(Now) & ".001+240"" date=""" & Replace(Date, "/", "-") & """ component=""PrintMapDelete"" context="""" type=""1"" thread=""0"" file="""    '& WScript.Application & " " & WScript.Version & """>"
 End Function

strSrvName1 = "\\server1\HP"
strSrvName2 = "\\server2\Dell"

Set WshNetwork = WScript.CreateObject("WScript.Network")
Set colPrinters = WshNetwork.EnumPrinterConnections
For intPrinter = 0 To colPrinters.Count - 1 Step 2
	strPrinterPort = colPrinters(intPrinter)
	strPrinterName = colPrinters(intPrinter + 1)
	LogEntry strPrinterName & " - " & strPrinterPort

	If left(colPrinters.Item(intPrinter + 1),len(strSrvName1)) = strSrvName1 Then
		LogEntry "	Printer matches target name.  Printer will be deleted"
		On Error Resume Next
		WshNetwork.RemovePrinterConnection strPrinterName
		If Err.Number = 0 Then
			LogEntry "	Printer was succesfully deleted"
		Else
			LogEntry "	An error occured while deleting the printer.  Error Number: " & Err.Number & " Error Description: " & Err.Description
		End If
	Else
		LogEntry "	Printer does not match target name.  No action required"
	End If

If left(colPrinters.Item(intPrinter + 1),len(strSrvName2)) = strSrvName2 Then
		LogEntry "	Printer matches target name.  Printer will be deleted"
		On Error Resume Next
		WshNetwork.RemovePrinterConnection strPrinterName
		If Err.Number = 0 Then
			LogEntry "	Printer was succesfully deleted"
		Else
			LogEntry "	An error occured while deleting the printer.  Error Number: " & Err.Number & " Error Description: " & Err.Description
		End If
	Else
		LogEntry "	Printer does not match target name.  No action required"
	End If
Next

Open in new window

ploftin

I'm wondering if perhaps another script or program is still running and has the file locked.

Can you please open Task Manager (CTRL + SHIFT + ESCAPE), change to the processes view (or Details view on Windows 8), and look for any processes called 'wscript' or 'wscript.exe'.  If you find any, end task on them.  Then try the script again.
Your help has saved me hundreds of hours of internet surfing.
fblack61
compdigit44

ASKER
Nothing is using the script an I only see the one instance of wscript and it goes away  after I close the error dialog box

I have tried three different computers all with the same result

 I am not a scripting person but trying hard to research this error and do not get what I am doing wrong..
compdigit44

ASKER
Any ideas!!!!

I have even tried to change the file location to C:\ on my workstation which I have local admin rights on and still get permission denied.. I am at a total lose an need to find a solution for this is week .. :o(
Joe Howard

I missed most of the discussion, did the code I wrote work? It worked fine for me.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
compdigit44

ASKER
I got the same error using your code.

Tried three different workstations 2 Windows 7 and 1 Windows 8 all gave permission denied error.

Why is this failing I am trying so hard to research this and stumped
Joe Howard

This is the file my code created, is this what it should look like?
file.txt
compdigit44

ASKER
Yes it does contain that text but a dialg box comes up with permission denied...
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Joe Howard

when do you get the permission denied?
compdigit44

ASKER
As soon as I double click the script to run an it is always on the OpenTextFile line.


 I did find something interesting. When I copy the script to my %username%b directory and run it from there I get Path Not Found.... This make me would if for some reason the script is not finding the %username% location...
Joe Howard

That's easy enough to find out. The following will display a message box with the user profile path:
Dim oWsh, strUserProfile , oFSO, oFile

Call LogEntry("TEST")

Function LogEntry (LogEntryText)
     Set oWsh = WScript.CreateObject("WScript.Shell")
     strUserProfile = oWsh.ExpandEnvironmentStrings("%userprofile%")
     MsgBox "The current users profile is located at: " & strUserProfile
     Set oFSO = CreateObject("Scripting.FileSystemObject")
     Set oFile = oFSO.CreateTextFile(strUserProfile & "\file.txt")
     oFile.Close
     Set oFile = oFSO.OpenTextFile(strUserProfile & "\file.txt", 8, True, 0)
     oFile.WriteLine "<![LOG[" & LogEntryText & "]LOG]!><time=""" & Hour(Now) & ":" & Minute(Now) & ":" & Second(Now) & ".001+240"" date=""" & Replace(Date(), "/", "-") & """ component=""PrintMapDelete"" context="""" type=""1"" thread=""0"" file=""" & WScript.Application & " " & WScript.Version & """>"
End Function

Open in new window

⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Joe Howard

I just noticed, your not using %username% right? you need %userprofile%.
compdigit44

ASKER
Sorry ... my script is using %userprofile% I was testing different combinations when I was trying to figure this out.

 I ran you test script from my desktop an it ran perfectly and showed by path as C:\users\MyName
Joe Howard

Does the script write the text to the text file?
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
compdigit44

ASKER
Yes the script did write to the file.txt
Joe Howard

In which case I fail to see what the problem is.
compdigit44

ASKER
This is why I am confused when I run the whole script just like I ran your test script I get permisson denied. I am using the same script I posted earlier.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Joe Howard

Does this script work:
strSrvName1 = "\\server1\HP"
strSrvName2 = "\\server2\Dell"

Set WshNetwork = WScript.CreateObject("WScript.Network")
Set colPrinters = WshNetwork.EnumPrinterConnections
For intPrinter = 0 To colPrinters.Count - 1 Step 2
    strPrinterPort = colPrinters(intPrinter)
    strPrinterName = colPrinters(intPrinter + 1)
    LogEntry strPrinterName & " - " & strPrinterPort

    If Left(colPrinters.Item(intPrinter + 1), Len(strSrvName1)) = strSrvName1 Then
        LogEntry "  Printer matches target name.  Printer will be deleted"
        On Error Resume Next
        WshNetwork.RemovePrinterConnection strPrinterName
        If Err.Number = 0 Then
            LogEntry "  Printer was succesfully deleted"
        Else
            LogEntry "  An error occured while deleting the printer.  Error Number: " & Err.Number & " Error Description: " & Err.Description
        End If
    Else
        LogEntry "  Printer does not match target name.  No action required"
    End If

    If Left(colPrinters.Item(intPrinter + 1), Len(strSrvName2)) = strSrvName2 Then
        LogEntry "  Printer matches target name.  Printer will be deleted"
        On Error Resume Next
        WshNetwork.RemovePrinterConnection strPrinterName
        If Err.Number = 0 Then
            LogEntry "  Printer was succesfully deleted"
        Else
            LogEntry "  An error occured while deleting the printer.  Error Number: " & Err.Number & " Error Description: " & Err.Description
        End If
    Else
        LogEntry "  Printer does not match target name.  No action required"
    End If
Next

Function LogEntry(LogEntryText)
     Set oWsh = WScript.CreateObject("WScript.Shell")
     strUserProfile = oWsh.ExpandEnvironmentStrings("%userprofile%")
     MsgBox "The current users profile is located at: " & strUserProfile
     Set oFSO = CreateObject("Scripting.FileSystemObject")
     Set oFile = oFSO.CreateTextFile(strUserProfile & "\file.txt")
     oFile.Close
     Set oFile = oFSO.OpenTextFile(strUserProfile & "\file.txt", 8, True, 0)
     oFile.WriteLine "<![LOG[" & LogEntryText & "]LOG]!><time=""" & Hour(Now) & ":" & Minute(Now) & ":" & Second(Now) & ".001+240"" date=""" & Replace(Date, "/", "-") & """ component=""PrintMapDelete"" context="""" type=""1"" thread=""0"" file=""" & WScript.Application & " " & WScript.Version & """>"
     oFile.Close
End Function

Open in new window

compdigit44

ASKER
Well I do not get a permissoin denied error but I get a dialog box that pops up showing by location as C:\users\MyUser name but will not go away when we click on it.

I think we " You" are getting close .. You are scripting master!!!!
Joe Howard

Delete line 41.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
compdigit44

ASKER
It working with no errors.. The only thing I noticed in the log file it that it states the printer was deleted but does listed which on..

Thank you so much for your help
Joe Howard

I'm sorry I don't understand. What information is missing?
compdigit44

ASKER
Sorry for the poor explanation. There are no errors and the script runs perfectly..  I noticed in the file.txt file it states a printer was deleted or not deleted but doesn't the the printer's name
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Joe Howard

Try this script, does it give you the names?
    Set WshNetwork = WScript.CreateObject("WScript.Network")
    Set oDrives = WshNetwork.EnumNetworkDrives
    Set oPrinters = WshNetwork.EnumPrinterConnections
    For i = 0 to oDrives.Count - 1 Step 2
        WScript.Echo "Drive " & oDrives.Item(i) & " = " & oDrives.Item(i+1)
    Next

Open in new window

compdigit44

ASKER
Should I run this script as it or add it to the order script you wrote earlier today?
Joe Howard

Run it separately.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
compdigit44

ASKER
I ran the script but it brought up a dialog box with my home folder path and nothing about printers.
Joe Howard

Sorry my bad, try this script:
         Set WshNetwork = WScript.CreateObject("WScript.Network")
         Set oDrives = WshNetwork.EnumNetworkDrives
         Set oPrinters = WshNetwork.EnumPrinterConnections
         WScript.Echo "Network drive mappings:"
         For i = 0 to oDrives.Count - 1 Step 2
            WScript.Echo "Drive " & oDrives.Item(i) & " = " & oDrives.Item(i+1)
         Next
         WScript.Echo 
         WScript.Echo "Network printer mappings:"
         For i = 0 to oPrinters.Count - 1 Step 2
            WScript.Echo "Port " & oPrinters.Item(i) & " = " & oPrinters.Item(i+1)
         Next

Open in new window

compdigit44

ASKER
After multiple dialog boxes if does end up listing my printers..
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Joe Howard

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
compdigit44

ASKER
It think it is working!!!

 I have to test it some more but so far it is looking good..........

You are a master... If I could award 50,000 points for this would ..

 I will post back shortly.
compdigit44

ASKER
Everything worked perfectly. Thank you so much for your help. Script is one of those things I have wanted to learn and even though this was stressfull I did learn something as well!!!!!
Joe Howard

Glad it worked. Thanks for the points.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy