Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: MS Dos bat file failure on first character  (Read 6714 times)

0 Members and 1 Guest are viewing this topic.

32handicap

    Topic Starter


    Starter

    MS Dos bat file failure on first character
    « on: February 03, 2010, 12:12:13 PM »
    Hi,
    I have a problem in that every .bat file i run fails because the there is an invisible character inserted at the beginning.  For example, if i make a simple bat file consisting of just one command, "pause", i get the following error message:

    '?p' is not recognized as an internal or external command, operable program or batch file.

    the ? is actually a solid rectangle, (ie funny invisible character).  Because of this, i cannot run any .bat files.  the 'p' is from pause.  If i start a bat file
    with a command starting with a different letter, i will get that letter.  So this pretty much tells me it is just inserting a funny character in front of the first
    character in my .bat file and failing immediately on that.
    Any help would be appreciated.  this is on XP service pack 3.  Thanks...

    Spoiler



      Specialist

      Thanked: 50
    • Experience: Beginner
    • OS: Windows XP
    Re: MS Dos bat file failure on first character
    « Reply #1 on: February 03, 2010, 12:14:35 PM »
    what are you using to make the batch files?

    try to open one in notepad and save it as a text file and then rename it to .bat

    Whenever I watch TV and I see those poor starving kids all over the world, I can't help but cry. I mean I would love to be skinny like that, but not with all those flies and death and stuff." - Mariah Carey, Pop Singer

    32handicap

      Topic Starter


      Starter

      Re: MS Dos bat file failure on first character
      « Reply #2 on: February 03, 2010, 12:16:55 PM »
      yes, i do make them in notepad. very vanilla.  Which is why i use the "pause" example.  of course just having pause in a .bat file is fairly useless.  But since i saw this happening, as part of my diagnosis, i just got down to the simple "pause" .bat file and it failed.  and i do make them wth notepad and rename them to .bat.

      Helpmeh



        Guru

      • Roar.
      • Thanked: 123
        • Yes
        • Yes
      • Computer: Specs
      • Experience: Familiar
      • OS: Windows 8
      Re: MS Dos bat file failure on first character
      « Reply #3 on: February 04, 2010, 04:54:52 AM »
      Try downloading Notepad++. It will probably circumvent your problem. It also has a lot of useful features, so I suggest you keep it even if it doesn't fix your problem.
      Where's MagicSpeed?
      Quote from: 'matt'
      He's playing a game called IRL. Great graphics, *censored* gameplay.

      Spoiler



        Specialist

        Thanked: 50
      • Experience: Beginner
      • OS: Windows XP
      Re: MS Dos bat file failure on first character
      « Reply #4 on: February 04, 2010, 06:46:02 AM »
      Can you post an example bat file? It would be interesting to see the problem.


      Thanks
      Whenever I watch TV and I see those poor starving kids all over the world, I can't help but cry. I mean I would love to be skinny like that, but not with all those flies and death and stuff." - Mariah Carey, Pop Singer

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: MS Dos bat file failure on first character
      « Reply #5 on: February 04, 2010, 12:54:33 PM »
      This should not be a problem with notepad.
      I can not duplicate the problem from you information.
      you can start notepad from the command line
      Code: [Select]
      Microsoft Windows XP [Version 5.1.2600]
      (C) Copyright 1985-2001 Microsoft Corp.

      d:\batch>start notepad test.bat

      Salmon Trout

      • Guest
      Re: MS Dos bat file failure on first character
      « Reply #6 on: February 04, 2010, 01:19:31 PM »
      I have a problem in that every .bat file i run fails because the there is an invisible character inserted at the beginning

      This is the clue:

      Quote
      '?p' is not recognized as an internal or external command, operable program or batch file.

      Diagnosis: file saved as Unicode. (Tested, reproduced)
      Solution: save file as ANSI. (Ditto)
      « Last Edit: February 04, 2010, 01:54:38 PM by Salmon Trout »

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: MS Dos bat file failure on first character
      « Reply #7 on: February 04, 2010, 02:01:48 PM »
      Salmon Trout, you rock!  :)

      32handicap

        Topic Starter


        Starter

        Re: MS Dos bat file failure on first character
        « Reply #8 on: February 05, 2010, 11:09:40 AM »
        Salmon Trout, you definately rock and are da' man, da' fishes, the da' whatever you want to be.  And i was the butler in this who-doneit all along.  As Monk, (if you ever saw the tv show),  would say: " here's what happened".  I must have, at one time, started to make a batch file from a ".txt" file i had saved once from the C# visual studio IDE or somthing like that.  Once i had the problem, I kept editing it with notepad even to the point of blanking out the file and then typing in "pause" for the test.  The fly was already baked in the ointment.  No amount of editing with notepad will fix it. 
         
        I just made a text file the C# express IDE and confirmed that it does "mess" up the file.  I "blanked" out the file and I did a file compare with a blank file i had just made from notepat and the compare utility showed the "invisible" character as a diff.

        This one was driving me crazy and I was coming to the point that i had to have it figured out. 

        THANKS TO ALL THAT WEIGHED IN AND ESPECIALLY THE BIG FISH IN THE BIG POND