Wrox Programmer Forums
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 31st, 2003, 10:58 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 119
Thanks: 0
Thanked 1 Time in 1 Post
Default HELP with .VBS file

I am writing a .vbs file and the highlighted part of my function code below is not working. The error that I am getting is "PATH NOT FOUND". What am I doing wrong? Here is the code (THANKS):

Function LogErrorToFile ()
    Dim objFS
    Dim objFile

    LogErrorToFile = False

    Set objFS = WScript.CreateObject("Scripting.FileSystemObject")

    If strYear + strMonth + strDay <> strDate Then
        Set objFile = objFS.CreateTextFile (strFile, False)
        Set objFile = objFS.OpenTextFile (strFile, 8, True) End If
Reply With Quote
  #2 (permalink)  
Old July 31st, 2003, 08:39 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 119
Thanks: 0
Thanked 1 Time in 1 Post

I found my problem. The IF statement was erroneous and caused my error.
Reply With Quote

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I attach a file to an email in my .vbs file savoym VBScript 3 July 2nd, 2011 08:02 AM
update xml file using vbs thesun99 XML 0 March 21st, 2005 02:32 AM
Question on .vbs file savoym VBScript 2 February 24th, 2005 12:12 PM
Sending mails through vbs file vc1 VBScript 1 February 2nd, 2005 02:45 AM
Scheduling VBS file madhukp VBScript 1 September 22nd, 2004 07:14 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.