none
error executing vbs script RRS feed

  • Question

  • Hello,

    My problem is reported in Pcs with Windows Vista SP2 32 bits joined to a Windows domain. It occurs in diferent machines (all with windows vista), but it works perfectly in windows xp or 7.

    An vbs script maps the shared units of the file server, but for some users the script fails because the LCASE function returns a NULL value (script4.vbs(8, 1) (null): Error not specified). For the other users LCase returns the correct result (the low case string)

    It doesn't seem be a permissions problem, because if a make a copy of a bad user, the new user works fine. And if I login with a bad user for first time in a machine, I have the problem, so I think that cannot be a problem of a corrupt profile.

    I paste here a little script that returns the null value:

    Dim grpname, mapline, prova1

    mapline = "aaa"
    grpname = "Domain Users,"

    msgbox mapline
    prova1 = LCase(mapline)
    msgbox prova1

     

    It's a little script, but the LCase function returns the null. What can it be?

    Casually, the users that report the problem cannot use Windows Search (it doesn't work). When they open the windows menu and type some to search,  they receive the message "Search failed to initialize". Windows Search service is running ok, and works for the rest of users.

    Thanks in advance for the help.

    Tuesday, September 6, 2011 8:38 AM

Answers

  • All the test the user works correctly. Then, the problem is only in the old computers. I don't understand, this computers are updated and I don't konw what difference cant it be. In addition, in the "bad" computers some users works perfectly...

    A few days ago I dealt with an issue where the poster was unable to create a new user account on his company machine. He then did this:

    1. Perform a Factory Restore.
    2. Create a new account. It worked.
    3. Install the company-specific software.
    4. Create a new account. It failed.

    The poster now knows that some part of the company-specific software interferes with the normal operation of Windows. You might be in the same situation. Alternatively, the problem could be caused by something you installed some time ago, then removed it. It could even be some neutralised malware or virus.

     

    Wednesday, September 7, 2011 11:51 AM

All replies

  • I suspect there is more to your script than you post here. I would put the following code into a script file all of its own, then execute it:

    Dim grpname, mapline, prova1
    mapline = "AAA"
    grpname = "Domain Users,"

    msgbox mapline
    prova1 = LCase(mapline)
    msgbox now() & prova1

    The "now"-function lets you ascertain that you execute the code you think you execute and not some other code fragment that happens to hang about.

    Tuesday, September 6, 2011 10:47 AM
  • Thanks for your response,

    Well, the script that maps the units is larger that it, but I reduce it because I found that the LCase function is the function that caused the error (I'm sure of it).

    Anyway, I did the test that you wrote, and I find that the now() function causes the same error, too. If I create a script that only contains a line:

    now()

    It works correctly. But If the line is:

    msgbox now()

    It causes the error. What can it be? It works on windows xp and 7, and windows vista with sp2 fails...

    Thanks

    Tuesday, September 6, 2011 11:44 AM
  • It works correctly. But If the line is:

    msgbox now()

    It causes the error. What can it be? It works on windows xp and 7, and windows vista with sp2 fails...

    Thanks

    Sounds like your VB script interperter is broken. Here are a few tests I would perform to drill a bit further down:

    • Execute the msgbox code with both wscript.exe and cscript.exe.
    • Replace msgbox with wscript.echo, then run the script with cscript.exe.
    • Test the problem script on different machines, preferably on at least one that exists outside your home or business (e.g. a friend's machine).
    • Test the script when booting into Safe Mode.
    • Run the System File Checker sfc.exe.
    Tuesday, September 6, 2011 12:30 PM
  • Is the error is always raised on the MsgBox function? If so, I would try variations, such as:

    MsgBox "Test"

    Call MsgBox("Test")

    Wscript.Echo "Test"

    The only time I get an error similar to yours is when I attempt to display a Null value. For example:

     

    Value = Null
    MsgBox Value


    Richard Mueller - MVP Directory Services
    Tuesday, September 6, 2011 1:14 PM
    Moderator
  • Hello,

    Pegasus:I have tried all the tests that you comment:

    • With wscript I have the same result
    • Witch wscript.echo I have the same result
    • On another machine works if it is windows xp or seven, vista fails.
    • In safe mode I have the same result
    • sfc.exe reports no error.

    Richard: It seems that you are in the correct way. It seems that, when the script fails, is because the now() and the LCase functions return NULL value. But why? the now() function always returns the actual time...I don't understand this behavior...

    Any ideas?

    Thank you!

    Tuesday, September 6, 2011 3:48 PM
  • Hello,

    Pegasus:I have tried all the tests that you comment:

    • With wscript I have the same result
    • Witch wscript.echo I have the same result
    • On another machine works if it is windows xp or seven, vista fails.
    • In safe mode I have the same result
    • sfc.exe reports no error.

    Any ideas?

    Thank you!

    It seems you missed the step where I replaced wscript.exe with cscript.exe.

    Is this "other" machine completely independent from you or is it one of a batch that you loaded/maintained or is on the same network as the problem machine? This test is only valid if carried out on a Vista machine that you had nothing to do with so far!

    Tuesday, September 6, 2011 4:50 PM
  • I did the test with wscript and I get a MessageBox with the message:

    Error: Error not specified

    Code: 80004005

    I did one more test, I did a fresh install of windows vista in a virtual machine and the user works fine. first, I did four test:

    - Fresh install

    - Install SP1

    - Install SP2

    - a Full windows update (no more update to apply)

    All the test the user works correctly. Then, the problem is only in the old computers. I don't understand, this computers are updated and I don't konw what difference cant it be. In addition, in the "bad" computers some users works perfectly...

    Wednesday, September 7, 2011 11:43 AM
  • All the test the user works correctly. Then, the problem is only in the old computers. I don't understand, this computers are updated and I don't konw what difference cant it be. In addition, in the "bad" computers some users works perfectly...

    A few days ago I dealt with an issue where the poster was unable to create a new user account on his company machine. He then did this:

    1. Perform a Factory Restore.
    2. Create a new account. It worked.
    3. Install the company-specific software.
    4. Create a new account. It failed.

    The poster now knows that some part of the company-specific software interferes with the normal operation of Windows. You might be in the same situation. Alternatively, the problem could be caused by something you installed some time ago, then removed it. It could even be some neutralised malware or virus.

     

    Wednesday, September 7, 2011 11:51 AM
  • Ok, I will try to find the software or the configuration that causes the error. If I find it I will comment here.

    Regards,

     

    Friday, September 9, 2011 1:42 PM