Bat file won't run unless "Open in Windows" selected

Discussion in 'Windows Virtual Machine' started by richardv1, Jan 26, 2023.

  1. richardv1

    richardv1 Bit poster

    I have recently upgraded to macOS Ventura (13.1) and Windows 10 running under Parallels Release 18 from an environment with macOS Catalina (10.15) and Windows 8.1 running under Parallels Release 15. I run Windows in coherence mode using one application (MSMoney) and a batch file that gets Stock price updates for MsMoney.

    Everything is fine except in the new environment the batch file (.bat) will only execute if I right click and select "open in Windows". If I double click the file opens in Windows Notepad. Previously a double click would execute the file. MsMoney executes fine from the macOS Dock with a single click.

    Is there a setting I have missed for the .bat file? I cannot find an alternative way of selecting Windows to execute the file.

    Thank you
  2. Adeboye Adeotan

    Adeboye Adeotan Staff Member

    Hello Richardv1,

    To make this work, you need to change file associations on your MacBook host.

    Please follow the steps outlined below to resolve this issue:
    1. Right-click the batch file on your Macbook host.
    2. Select the Get Info option.
    3. Under the Open With section click on the drop-down menu:
    4. Choose "Command Prompt" if it is listed. If it is not listed, click "Other":
    5. On the opened window, in the dropdown menu choose Macintosh HD -> then Users -> your user name -> Applications (Parallels) folder, and open the appropriate virtual machine folder:
    6. Choose "Command Prompt" to open this file type from the list
    7. At the end, click the Change All... option in the Get Info window and close the dialog.
    8. Launch the batch script.
    If the command prompt launches successfully but the script does not execute, please perform the steps outlined below:
    1. make the following adjustment to your batch script, add "pushd %~dp0" and "popd" to the beginning and end of the batch script respectively.

    pushd %~dp0
    *your batch script*

    2. In your windows environment, right-click the batch file
    3. Click on create shortcut.
    4. Copy the shortcut to your Macbook host
    5. Launch the batch file.
    6. If the issue persists, please collect a technical report (click Parallels icon || > Help > Send technical data > check "Attach screenshots..." > press Send Report) and send the report's 9-digit ID in a reply to this post.
  3. richardv1

    richardv1 Bit poster

    Thanks for the prompt & comprehensive response, especially as it has worked.
    Thanks again

Share This Page