3

Posting this question on behalf of GNU Octave trying to troubleshoot execution problems. We've recently had a handful of Windows users install the software and be unable to run the program. Often they get no errors, messages, or useful feedback, they double click the startup icon and nothing happens.

In a recent case, we were able to work with the user to narrow the problem down to his system being unable to execute VBS scripts. Octave uses an octave.vbs file (called with wscript) to set path and environment variables and start the program.

Current diagnostic attempts:

  • The user created a simple test script on his desktop as per this example to just pop up a system dialog. He is unable to execute the script, and gets no popup or error message.
  • Had him move the file to different locations, like C:\temp, the same folder as Octave, etc., and the file would not execute.
  • Verified wscript's existence by having him run wscript from the run dialog, and the "Windows Script Host Settings" dialog popped up.
  • Right clicking the script file and checking Open With shows the default file association is with "Microsoft windows based script host" as it should be (and clicking that produces no script execution.)
  • Shift-right click and 'run as administrator' makes no difference.
  • Temporarily disabling Antivirus real time protection makes no difference.
  • Checked registry entries to make sure there is no Enabled=0 key as per this article (there is not).

Can anyone provide guidance on what Windows or other settings would prevent vbs scripts from running, and how we can correct this issue? Or what further things to check to identify the problem? Is there some new default security setting in Windows or coming with updates that would account for this?

User is running Windows 10 Home and the built-in Windows Defender and the latest updates. It's not a managed system. No special security settings were ever changed deliberately/knowingly by him. Version info below:

  • Windows specifications:
  • Edition: Windows 10 Home
  • Version: 2004
  • Installed on: 2020-01-10
  • OS build: 19041.421
  • Experience: Windows Feature Experience Pack 120.2212.31.0

For reference the original discussion thread with this problem can be found on the Octave discussion forum, but I think I've captured all relevant information above.

EDIT: Adding a note from a maintainer list discussion - for users that cannot run a vbs file for any reason, the octave.bat file is still present on the system, located in the mingw64/bin folder. A user can change the desktop shortcuts to point to that file instead of the octave.vbs file and octave should run without issue, although there might be some aesthetic changes with additional command prompt windows visible at times.

EDIT2: just a note for posterity - Since Octave 7, vbs scripts are no longer used to launch the program. A octave-launch.exe file is used instead. The .vbs and .bat launchers are still present, but VBS launch issues as described in this question are now less of an issue.

12
  • 1
    Check his PATHEXT environment variable. Make sure .VBS is on the list. Mine looks like this C:\Users\frodo_baggins>echo %PATHEXT% ----- .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC Commented Aug 22, 2020 at 20:16
  • user checked and .VBS is there
    – Nick J
    Commented Aug 23, 2020 at 0:55
  • 1
    Not a solution, but why do you need VBS for something as simple as setting path and environment variables and starting a program? A simple batch script will do it and is guaranteed to work. If you would like to avoid a black CMD window see this post.
    – harrymc
    Commented Aug 25, 2020 at 8:53
  • 1
    Does the sample script run if you execute it like this from CMD Prompt or Run: wscript.exe C:\test.vbs (or) cscript.exe C:\test.vbs
    – w32sh
    Commented Aug 25, 2020 at 15:54
  • 1
    It seems that VBS can cause problems, which is news to me. Would you be interested in a solution for hiding a bat file?
    – harrymc
    Commented Aug 25, 2020 at 16:56

4 Answers 4

1
+50

Based on the ProcMon log, it has been found that wscript.exe was loading 4 anti-virus software modules (3 Avast & 1 McAfee IOfficeAntiVirus module).

enter image description here

The McAfee IOfficeAntiVirus module is the most likely culprit which is blocking wscript.exe from executing scripts.

Completely uninstalling McAfee ought to fix the problem.

2
  • so, it turns out the user, while thinking that he only had windows defender running on his system, had multiple other AV apparently active. I'm not certain how that was possible, as in general windows should only allow a single AV to be active. Perhaps there was bundled software with the PC that had expired but was still present? Will update if the user provides any other clarification. Running the procmon with wscript call was the key here to finding out what was actually happening to prevent execution. 'Deleting' McAfee (as the user said. uninstall assumed) allows Octave to run
    – Nick J
    Commented Aug 26, 2020 at 3:45
  • 1
    It's likely that McAfee's IOfficeAntiVirus module registry keys are/were still active. In case of further issues of a similar kind, McAfee has a clean uninstaller tool that should do the trick.
    – w32sh
    Commented Aug 26, 2020 at 3:48
2

Diagnosis

Make sure that "%SystemRoot%\System32\WScript.exe" exists. You can check that with the file explorer (press WIN + E) - type the path %SystemRoot%\System32 into the file explorer's text box to view that directory, then look for WScript.exe there.

Open a command window (press WIN + R then enter cmd.exe) and type the following:

ftype | find /I "VBS"

That should give the result:

VBSFile="%SystemRoot%\System32\WScript.exe" "%1" %*

Then, check

assoc .vbs

which should show:

.vbs=VBSFile


Fix

If any of the above are not correctly set, then your VBS file will not run. To fix the file type (FTYPE) simply run the command

ftype VBSFile="%SystemRoot%\System32\WScript.exe" "%1" %*

To fix the association, run the command

assoc .vbs=VBSFile

If that is all correctly set and the issue still persists, it is likely that anti-malware software is blocking the execution - in that case, look into the answer w32sh gave.

2
  • thanks. have verified wscript location previously. also file associations through windows dialogues, but will ask him to check the ftype and assoc through CLI to see if anything different pops up.
    – Nick J
    Commented Aug 25, 2020 at 15:20
  • verified that all three points are as they should be. wscript is present, ftype and assoc are as expected.
    – Nick J
    Commented Aug 25, 2020 at 16:09
1

I don't know if this is going to help or not but I wanted to share my experience in resolving similar symptoms observed after upgrading my device to the following specs

  • Edition Windows 10 Pro
  • Version 2004
  • OS build 19041.450
  • Experience Windows Feature Experience Pack 120.2212.31.0

The device has only one VBScript which is supposed to be running at startup but stopped doing so straight after the upgrade. It's also worth mentioning that the script didn't exist when previous upgrades were installed so at this stage I can't say if the problem is specific to version 2004 or if this is an issue that pertains to W10 upgrades in general.

The issue observed is that instead of being executed at startup, Notepad++ was opening a page displaying the script content. I also noticed that the icon associated with the file holding the script had been changed to the Notepad++ icon after the upgrade.

So, I went to check the file association in the W10 UI (Start > Settings > Apps > Default apps > Choose default apps by file type), and here I could see that the .vbs extension was already assigned to "Microsoft Windows Based Script Host". I then changed the default app by manually selecting "Microsoft Windows Based Script Host" again and then suddenly the file started displaying the Microsoft-generated icon for .vbs items.

From there I was able to run the script manually and automatically at startup as well.

On a side a note, I have also seen my AV blocking some PowerShell commands (but not all) when called directly from with an Excel VBA module, but this has never impacted the execution of the aforementioned script though.

0

You should check if there is not another antivirus that blocks your vbs file from running !

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .