none
New VBScript error - was for years working, today it does not. RRS feed

  • Question

  • I have a script on my servers that pulls data for running time of our equipment. It's been running fine for years, every day task scheduler kicks it off and it generates a text file report. This morning, the VBScripts fails (on all servers that have been running the script) with the error:

    "Script:

    ' path to script...'.vbs

    Line: 2

    Char: 1

    Error: Subscript out of range

    Code: 800A0009

    Source: Microsoft VBScript runtime error"

    The code giving error start with this:

    Set args = WScript.Arguments
    strServerName = args.Item(0)
    strUnitNum = Right(strServername,1)
    strChannelName= "'" & strUnitNum & "_DB_HEATG'"

    'wscript.Echo strServerName,strUnitNum

    dblValue = 0.00

    dteToday = Date

    I have searched for the error and the articles are all older with resolutions that are not applicable so I am at a loss. Something changed on something, but the script that was working no longer does, so I do not expect it is the actual vbscript code causing the problem.

    • Moved by Bill_Stewart Wednesday, September 4, 2019 9:41 PM Unanswerable drive-by question
    Friday, May 3, 2019 12:13 PM

All replies

  • Sorry but we cannot troubleshoot your systems.  You will need to contact a trained tech to help you fix this.  As you posted - the script has always worked so it is not the script that is the issue.  You need to find what has been changed on your servers.

    If this is disrupting production systems then contact Microsoft support for assistance.

    This Forum is for   Scripting   Questions Rather than script requests

    How to ask   questions in a technical forum


    \_(ツ)_/

    Friday, May 3, 2019 12:51 PM
  • Well, I am betting this is Microsoft patch related, so I figured someone on the VB Script forum would run across the same kind of issues as I have and MS would have to figure out a fix.

    But thanks for your reply, it is totally helpless.

    Friday, May 3, 2019 1:30 PM
  • Well, I am betting this is Microsoft patch related ...

    Well, that should be easy to confirm - uninstall the shortly installed patch or patches and run your script again.  ;-)

    Live long and prosper!

    (79,108,97,102|%{[char]$_})-join''

    Friday, May 3, 2019 1:39 PM
  • If you think it is patch related then MS will provide support for free assuming it is not network or OS related.

    Also you have not provided sufficient diagnostic detail.  YOU have not posted the complete error message.

    If you do not know scripting or Windows technology then find someone in your organization who does and get them to help you get all of the compete and correct diagnostic data.


    \_(ツ)_/

    Friday, May 3, 2019 1:40 PM
  • I posted the complete error message popup text, minus the patch to the file. Is there something else I can post you want event log data or something? 

    What is confusing to me is I cannot find any patches that were applied overnight.

    Friday, May 3, 2019 1:57 PM
  • The second line of the script is wrong and has always been wrong.  There is no way this script has been running correctly.

    The first two lines of the script can never have run correctly as the syntax is bad.

    Place the first three lines in a VBS file and run that file.  It will produce the same error.

    This script has not been running for years as it is posted.  Either you or someone edited it or you have the wrong script.

    The correct lines are:

    If WScript.Arguments.Count >= 1 Then
    	strServerName = WScript.Arguments(0)
    Else
    	MsgBox "Arguments missing"
            WScript.Quit
    End If


    \_(ツ)_/


    • Edited by jrv Friday, May 3, 2019 2:22 PM
    Friday, May 3, 2019 2:22 PM
  • To clarify this.  If you have tried to create a ne task to run this code then the issue is likely that you created the task without the required arguments.

    Perhaps someone edited the task and removed or changed the arguments.

    If you continue to have issue then you will need to contact a tech with Windows experience to help you determine what has been changed.


    \_(ツ)_/

    Friday, May 3, 2019 2:27 PM