How to allow my computer to run bat files?

Abdullah Alwan 0 Reputation points
2024-02-13T19:06:21.6833333+00:00

Hi, I turned a text file (with code) into a .bat file, and tried to open it, and all It said was:
User's image

Windows 11

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,345 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jiale Xue - MSFT 49,361 Reputation points Microsoft External Staff
    2024-02-14T06:46:40.0366667+00:00

    Hi @Abdullah Alwan , Welcome to Microsoft Q&A,

    If private information is not included, you can show the bat command you are trying to convert.

    Did you launch it with sufficient permissions? (try using administrator rights)

    Make sure the commands or operations in the batch file are compatible with your version of Windows.

    Create a simple .bat file with just a single command (e.g. "echo "Hello, World!") and see if it executes correctly. If it does, gradually add more complexity to the script to identify the problem. Double check the syntax and suffix is .bat.

    Best Regards,

    Jiale


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.