Share via

CREATING BATCH FILE.

Anonymous
2018-08-10T09:33:47+00:00

Sir, 

I tried to create a batch file form text document created in note pad using the command xyz.bat but it does not work. Is there any problem with the computer setting ? and if yes how do I change the setting.

Thanks.

Windows for home | Windows 10 | Accessibility

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

3 answers

Sort by: Most helpful
  1. Anonymous
    2018-08-10T12:29:34+00:00

    Make sure the file has the .bat suffix. Notepad may have "sneaked" a .txt on the end ...

    Other than that there is nothing special you have to do for a batch file to work.

    Try adding a couple of PAUSE commands to stop the execution to see what is happening. Just in case there is a error message that you are not seeing because it flashes by so fast.

    Try building up your bat file in small increments of a command or two at a time. Always end with a Pause to see what is going on.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2018-08-10T10:46:50+00:00

    As DaveM121 is highlighting, the file is most probably setting the TXT extension on to the end of the file name, i.e. the file is being saved as xyz.bat.txt

    When you save the file, you can overcome this by putting a double quote at the start of the file name and a double quote at the end

    "xyz.bat"

    this will save the file as a .bat extension.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2018-08-10T09:37:03+00:00

    Hi Ramakant,

    Open the file in Notepad,

    Choose File - Save as

    At the bottom of the save dialog, set 'Type of File' to all files *.*

    Then save the file with a name and manually add .bat in that box

    Does that create the batch file for you?

    Was this answer helpful?

    0 comments No comments