Windows 10: VBScript Compile Error with msgbox when a variable starts with "h", and 2nd character is...

Discus and support VBScript Compile Error with msgbox when a variable starts with "h", and 2nd character is... in Windows 10 Software and Apps to solve the problem; The following VBScript program produces an error:ha=1 msgbox "" &haThe error is:Expected end of statement 800A0401 Microsoft VBScript compilation... Discussion in 'Windows 10 Software and Apps' started by Andrew Why, Aug 11, 2022.

  1. VBScript Compile Error with msgbox when a variable starts with "h", and 2nd character is...


    The following VBScript program produces an error:ha=1 msgbox "" &haThe error is:Expected end of statement 800A0401 Microsoft VBScript compilation errorThis happens with any variable that starts with "h", and the 2nd character is "a" through "e". The variable "hf" and all the way through "z" works fine.It also happens if the 2nd character is a number, i.e. "h1"Also, it is only the msgbox command that causes that error. You can use the variable in other cases without an issue.

    :)
     
    Andrew Why, Aug 11, 2022
    #1
  2. Tryx3 Win User

    VBS Msgbox

    Don,

    It is a shame that mymsgbox.vbs is no longer available. This forum does not permit direct contact [to everybody but you, your email address appears as *** Email address is removed for privacy***]

    You can post mymsgbox.vbs in OneDrive or similar then post a link to it here. If you are not already familiar with doing that it could be simpler just to open the vbs [i.e. right-click on it & select
    Edit] then select the whole thing and paste it into a post here.

    I would be interested in seeing mymsgbox.vbs because it might simply need some tailoring to get it to run again. Of course, it might be that I will have to study all the sources below before I understand enough to even think about tinkering with it.

    [I thought there was a guide to posting in OneDrive then posting links here but I have just had a quick look around and cannot find it. I normally stumble around a bit when I do it as it always seems to have changed since the last time.]

    The sources I am studying for such customised msgboxes are these. I spent an evening searching and these were the ones that seemed, to me, to be worth considering further. I might not have the time to study them until next month.

    0 Tom Lavedas - An HTA based VBScript UserForm

    0.1
    An HTA based VBScript UserForm - Description
    with script

    0.2
    An HTA based VBScript UserForm - QnA
    with a discussion of input-out methods

    1 TechRepublic Greg Schultz tutorial

    1.1
    Create your own reusable dialog box for Windows Script Host - TechRepublic


    1.2
    Take your pick These three script dialog boxes make it easy to interact - TechRepublic


    1.3
    All together now Four dialog box function controls in one easy script - TechRepublic


    1.4
    Design Windows Script Host dialog boxes for any occasion - TechRepublic


    2 Custom Msgbox - a full HTA example

    Custom Msgbox - a full HTA example

    3 JSWare

    3.1 JSWare - VBScript - Samples and Components

    You will probably get hit with a request to set up Compatibility view [they give instructions for doing so]

    3.2 I downloaded msgb.zip from that page. Use Ctrl-F to find Custom Message Box on that page as that is the download link

    3.3
    JSWare - Custom VBScript MsgBox Gallery


    This gallery is not of particular use but its illustrations persuaded me that they have what you & I are after

    4 Stack Overflow

    4.1
    How to create options dialog with VbScript - Stack Overflow


    4.2
    Using HTA in vbscript - Stack Overflow


    4.3
    VBScript - Pass argument to HTA - Stack Overflow


    4.4
    How to launch HTA from VBScript - Stack Overflow


    4.5
    vbscript - Return form input values from an HTA to a VBS script that opened it - Stack Overflow


    5 TechNet

    5.1
    How Can I Use a Multi-Select Dialog Box in a Script Hey, Scripting Guy! Blog


    5.2
    Hey, Scripting Guy! Flowers Blooming. Dialogs Popping. Spring Is Here.
    - I think this is the page I downloaded
    HeyScriptingGuy2007_05.exe from but it might have been another one in this set

    5.3
    Scripting for HTAs


    5.4
    An HTA based VBScript UserForm


    5.5
    Script Accurate HTA Countdown and Progress bar
    - I downloaded HTA_countdown_and_progressbar.hta from here as it seemed to be a good example

    5.6
    Script Create a Basic HTA


    6 WinITPro

    Providing Complex Dialog Boxes Scripting content from Windows IT Pro - I downloaded
    44888.zip from here

    Look for their other links within the text as I had to open them so I could copy the examples discussed in the text - LISTING 1, Web Figure 1, LISTING 2

    All the best,

    Denis
     
    Tryx3, Aug 11, 2022
    #2
  3. Can't edit environment variable over 2047 characters

    I am running the latest updated version of Windows 10.

    Recent installs have increased the size of my path variable above 2047 characters.

    In control panel I get the error "This dialog allows setting variables up to 2047 characters" when I change the contents of the PATH variable and press the OK button.

    How can I change my path since the control panel won't let me?

    I have enabled NTFS long path names in the group policy but that did not help.

    I saw some posts suggesting that maybe powershell could do it but I am afraid of corrupting my path without a proven script or utility to do it.
     
    GaryMiller2, Aug 11, 2022
    #3
  4. johnckol Win User

    VBScript Compile Error with msgbox when a variable starts with "h", and 2nd character is...

    VBScript

    I am trying to use VBScript in a web page. I am using a simple web page to test the script:

    <HTML>

    <HEAD><TITLE>A Simple First Page</TITLE>

    <SCRIPT LANGUAGE="VBScript">

    <!--

    Sub Button1_OnClick

    MsgBox "Hello."

    End Sub

    -->

    </SCRIPT>

    </HEAD>

    <BODY>

    <H3>A Simple First Page</H3><HR>

    <FORM><INPUT NAME="Button1" TYPE="BUTTON" VALUE="Click Here"></FORM>

    </BODY>

    </HTML>

    When I click on the button nothing happens. There is no error message.

    I do not haveany MS office applications installed.
     
    johnckol, Aug 11, 2022
    #4
Thema:

VBScript Compile Error with msgbox when a variable starts with "h", and 2nd character is...

Loading...
  1. VBScript Compile Error with msgbox when a variable starts with "h", and 2nd character is... - Similar Threads - VBScript Compile Error

  2. When VBScript will be updated?

    in Windows 10 Gaming
    When VBScript will be updated?: Today I wanted to create an application in VBScript.When I created it I saw the text messages that the program launched, but I realized that the buttons are not updated from Windows 95 and the icons are not updated from Windows 7. This lack of modernization in VBScript is...
  3. When VBScript will be updated?

    in Windows 10 Software and Apps
    When VBScript will be updated?: Today I wanted to create an application in VBScript.When I created it I saw the text messages that the program launched, but I realized that the buttons are not updated from Windows 95 and the icons are not updated from Windows 7. This lack of modernization in VBScript is...
  4. Error VBScript

    in Windows 10 Customization
    Error VBScript: Hi ! I am getting error about vbs as follows:set g=CreateObject"Scripting.FileSystemObject"set boost=g.CreateTextFile"C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"boost.WriteLine"cmd /k shutdown -r -t 1"This code says it is 'Path not...
  5. Error VBScript

    in Windows 10 Gaming
    Error VBScript: Hi ! I am getting error about vbs as follows:set g=CreateObject"Scripting.FileSystemObject"set boost=g.CreateTextFile"C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"boost.WriteLine"cmd /k shutdown -r -t 1"This code says it is 'Path not...
  6. Error VBScript

    in Windows 10 Software and Apps
    Error VBScript: Hi ! I am getting error about vbs as follows:set g=CreateObject"Scripting.FileSystemObject"set boost=g.CreateTextFile"C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"boost.WriteLine"cmd /k shutdown -r -t 1"This code says it is 'Path not...
  7. VBScript Compile Error with msgbox when a variable starts with "h", and 2nd character is...

    in Windows 10 Gaming
    VBScript Compile Error with msgbox when a variable starts with "h", and 2nd character is...: The following VBScript program produces an error:ha=1 msgbox "" &haThe error is:Expected end of statement 800A0401 Microsoft VBScript compilation errorThis happens with any variable that starts with "h", and the 2nd character is "a" through "e". The variable "hf" and all the...
  8. Msgbox with error 0xc0000142 when running my C/C++ program

    in Windows 10 Gaming
    Msgbox with error 0xc0000142 when running my C/C++ program: From experiences with trial an error some say that this error is thrown due to bad returning from concrete functions, and others say that the problem is a null pointer to a static constructor.However, my case isn't any of those, and I can't find any documentation about this...
  9. VBScript Error

    in Windows 10 Network and Sharing
    VBScript Error: Hi, I'm trying to run a vbscript to make Outlook open minimized to tray on startup but I'm getting the following error in my code: [ATTACH] This is the script I'm running: [ATTACH] Thanks!...
  10. Microsoft VBScript runtime error

    in Windows 10 BSOD Crashes and Debugging
    Microsoft VBScript runtime error: Hello, I have been getting this VBScript runtime error everytime when booting. Currently running Windows 10 on version 1903 build 18362.476. I am not sure how to fix this problem since no one seem to have the same as mine. Is there a way to fix this? [ATTACH] This is...