Share via

How do I run VBscript in Win11 24H2

Anonymous
2025-04-23T10:14:03+00:00

I have a VBscript that runs a bat-file to start up a program and set some startup-parameters - and it has worked in Win10.

Now I have changed to Win11 and it does not react to double-click. I used to have a shurtcut placed in the Startup folder - but that does not work either.

The bat-file does also not react to double-click.

How do I get it working?

I would prefer just to run the VBscript as I have other scripts I would like to use.

If not - what are the alternatives?

Windows for home | Windows 11 | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

6 answers

Sort by: Most helpful
  1. Anonymous
    2025-04-23T11:38:51+00:00

    Hi Ramesh,

    I don't want to install some non-windows file association tool so I tried renaming the bat-file to .cmd

    But it does still not react to double-click.

    And I followed the link about VBS deprecation. VBSCRIPT is already added as a feature in the "optional features".

    But I am not sure if it is associated with the .vbs file type anymore. Right-clicking a VBS-file shows it associated with "Microsoft Windows Based Script Host", but it does not run the script.

    I dont know which other program I should search for for the .vbs association?

    So I have not come any further.

    I understand that VBscript is now being phased out - but I am not sure what the alternative is, so for now I would like to be able to use my .bat and .vsd as I did in win10.

    Jake

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2025-04-23T12:51:32+00:00

    Hi Ramesh,

    now it works...

    Testing with "msgbox" in VBS and "pause" in the bat-file revealed the issues. It actually did work - in the sense that it did run - but I just never saw it because it was just a glimpse...

    And then - big surprise - it turns out that the path to an .exe file has the be the correct win11 path - and not the one from Win10.

    But with all that fixed - it works.

    Thanks for helping me along.

    Was this answer helpful?

    0 comments No comments
  3. Ramesh Srinivasan 81,160 Reputation points Independent Advisor
    2025-04-23T11:42:52+00:00

    The .vbs association doesn't sound like your issue. But the batch/cmd file is not running whether launched using the .vbs or directly.

    To test if .vbs is working, create a "test.vbs" file with the following code:

    msgbox "Hello World"
    

    Run "Test.vbs". If it shows the Hello World message, .vbs association is fine.

    What happens when you right-click on the batch or .cmd file and click "Open"?

    Also, open a Command Prompt window and run the batch (or .cmd) file by mentioning the file name? Does the file execute correctly?

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2025-04-23T11:40:06+00:00

    Hey,

    Sounds like a permissions issue or Windows 11 being picky. Try this:

    1. Right-click the .vbs and .bat files → Properties → make sure "Unblock" is checked if it's there.
    2. Make sure you're not running into UAC restrictions try running the script as admin.
    3. For Startup, try Task Scheduler instead of the Startup folder create a basic task that runs your VBScript at logon.

    That should bring it back to life.

    –kevin

    Was this answer helpful?

    0 comments No comments
  5. Ramesh Srinivasan 81,160 Reputation points Independent Advisor
    2025-04-23T10:54:05+00:00

    Hi, This is Ramesh.

    If double-clicking the batch file does not work, please check the batch file associations.

    The following file association can help.

    https://www.elevenforum.com/attachments/bat-reg...

    (Source: https://www.elevenforum.com/t/reset-and-restore...)

    Download and run the REG file. Click Yes to confirm.

    If that doesn't help, right-click on a batch file and click "Open". Or, rename the .bat file to a .cmd file and run it.

    Note:

    VBScript is supported in Windows 11. However, it's an optional feature in 24H2.

    VBScript deprecation: Timelines and next steps | Windows IT Pro Blog:

    https://techcommunity.microsoft.com/blog/window...

    Standard Disclaimer: There is a link to a non-Microsoft website. The page appears to provide accurate, safe information. Watch out for ads on the site that may advertise products frequently classified as PUPs (Potentially Unwanted Products). Thoroughly research any product advertised on the site before you decide to download and install it.

    Was this answer helpful?

    0 comments No comments