Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7170529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:13:55+00:00 2026-05-28T15:13:55+00:00

During an install of PostgreSQL 9.1.2 on my Windows 7 64-bit Home Premium box,

  • 0

During an install of PostgreSQL 9.1.2 on my Windows 7 64-bit Home Premium box, the installation hung. After a long furious search I discovered the problem was that an installer VB Script was hung waiting for a batch file to complete in a hidden window.

I isolated the problem to the following line of code:

Dim objShell
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "hello.bat", 1, True

(where 1 sets WindowStyle to Visible and True waits for completion). The Run call had launched the command prompt but was not executing the batch file. Thus, it would never complete.

I solved the problem by launching cmd.exe instead of the batch file directly, according to numerous online sources:

objShell.Run "%COMSPEC% /c hello.bat", 1, True

Since the fix is buried in the PostgreSQL installer (and I’ve submitted a bug report), I can only work around the problem unless the installer is modified.

But my main questions are:

  1. Why does the first call hang?
  2. Why use %COMSPEC% instead of calling the batch directly?

In regards to #2, could this be because executing a .bat directly makes an assumption that the default action associated with a .bat file is to execute it? I’ve in the past (on other machines) changed this default action to ‘Edit’. And if I’d done that, I would have hung the PostgreSQL installer as well! (I imagine)

The batch file executes normally on other machines. So there is something weird on this one laptop. So in regards to #1, I need to figure out why this one laptop is different. I should note that there are some weird behaviors with batch files on this machine (one which I just noticed):

  1. The context menu actions contain only “Open” and are missing “Edit”, “Run”, “Run As”
  2. Double-clicking a batch file opens a command prompt but does not execute the batch file

I just noticed #2 while writing this. Clearly the default action for .bat is messed up. Yesterday I nearly bricked my computer removing Context Menu Handlers from my registry as recommended by several sites trying to restore my “Edit”, “Run”, etc. entries.

Any advice on questions 1 and 2 would be appreciated.

Thanks,
Eric

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:13:55+00:00Added an answer on May 28, 2026 at 3:13 pm

    The problem was an HKCU override on .bat which created an association to cmd.exe, as noted on this wonderful post. Additional help was found here.

    My registry looked like this:

    HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bat
        \OpenWithList
            (Default)   REG_SZ    (value not set)
            a           REG_SZ    NOTEPAD.EXE
            MRUList     REG_SZ    a
        \OpenWithProgids
            (Default)   REG_SZ    (value not set)
            batfile     REG_NONE  (zero-length binary value)
        \UserChoice
            (Default)   REG_SZ    (value not set)
            Progid      REG_SZ    (Applications\cmd.exe)
    

    Removing the entire .bat entry fixed everything. All context menu items were restored properly (Open, Edit, Print, Run as Administrator, and Troubleshoot Compatability) and double clicking on the batch file executed the batch.

    The .bat key re-generated automatically sometime after I deleted it and double-clicked my test batch file. This automatically generated entry was:

    HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bat
        \OpenWithList
            (Default)   REG_SZ    (value not set)
        \OpenWithProgids
            (Default)   REG_SZ    (value not set)
            batfile     REG_NONE  (zero-length binary value)
    

    Ultimately it was the \UserChoice key that was causing my problem. So I’m all cleared up now. My test scripts run properly and I re-installed PostgreSQL from scratch and the install went smoothly.

    E

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've searched around online but can't find what I'm after. Basically, during an install,
During the installation of my app, I want to create a PostgreSQL-Database and some
During install of a windows service (using class MyServiceInstaller : Installer, and ServiceInstaller and
Sometimes it's necessary to modify Windows registry settings during an application install. I've recently
Can I ask the user WHERE to install the application during install time? Most
I have a command line I want to run during the install of a
I'm working on an installer project, during the install process I'd like the user
I am trying to install RedMine on a server. During the procedures as explained
During the development I experience unhandled exceptions at random occasions, but mostly after closing
I'm on Ubuntu 12.04 64 bit on Amazon EC2. Trying to upgrade postgresql from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.