Solved commands not recognized internal/external.. need help!

m18xr2

Member
Member
Messages
70
need some help here this is driving me crazy lol. using windows 8.
I have being using my windows for a very long time and its all setup, only thing that really doesn't work is making customized .bat file and try to run it, always giving me "is not recognized as an internal or external command."

now I have tried the same .bat file and works on another machine on a fresh install but fresh install windows is not an option on this one as I have way too much stuff done already.

this is whats in the a.bat file:
"taskkill /F /IM Steam.exe"

it is a simple straight forward taskkill of a software that would work and I don't need to set path as it is built in default into windows. if I type the full command "taskkill /F /IM Steam.exe" this under ANY directory in windows, any drive, it will kill steam.exe.

however if I were to run .bat file this is what I get:

t.jpg

s.jpg

as you can see above it doesn't recognize the command because it seems theres something or some "unknown letters" infront of t for taskkill. by changing taskkill to saskkill, it also shows those unknown letter is infront of s, so this actually is applying to every single of my .bat file and I am unable to run them. only way again is for me to type out entire command which is quite annoying as I can't make any shortcuts.

also, as you guys can see in the pictures, the slash is replaced with japanese symbol that is because I am using japanese system locale and no, switching back to english default language and locale still doesnt solve the problem..

please help, I am at wits end and can't seem to find any similar issue to mine on google.



solved, look at screenshot below. use notepad++ to change encoding and it'll work. or use the "echo" function below to create a clean .bat file.

t.jpg
 
Last edited:

My Computer

System One

  • OS
    windows 8.1 and server 2012 R2
What happens if you just type in the command instead of running the batch?

I know in command prompt there can be issues with the code page. But I don't know enough about it to advise you. Perhaps another poster will have more specifics.
 

My Computer

System One

  • OS
    Windows 8.0 x64
    Computer type
    Laptop
    System Manufacturer/Model
    Toshiba Satelite C55D-A Laptop
    CPU
    AMD EI 1200
    Memory
    4 gb DDR3
    Graphics Card(s)
    Raedon 340 MB dedicated Ram
    Monitor(s) Displays
    Built in
    Screen Resolution
    1366 x 768
    Hard Drives
    640 GB (spinner) Sata II
    Keyboard
    Built in
    Mouse
    Touch pad
What happens if you just type in the command instead of running the batch?

I know in command prompt there can be issues with the code page. But I don't know enough about it to advise you. Perhaps another poster will have more specifics.

hey, if i type just the command it will work. but if i were to create a .bat file then this happen, on every single bat file i create and i seriously have no idea why.
 

My Computer

System One

  • OS
    windows 8.1 and server 2012 R2
Try changing the extension from .bat to .cmd.
 

My Computer

System One

  • OS
    Windows 8.0 x64
    Computer type
    Laptop
    System Manufacturer/Model
    Toshiba Satelite C55D-A Laptop
    CPU
    AMD EI 1200
    Memory
    4 gb DDR3
    Graphics Card(s)
    Raedon 340 MB dedicated Ram
    Monitor(s) Displays
    Built in
    Screen Resolution
    1366 x 768
    Hard Drives
    640 GB (spinner) Sata II
    Keyboard
    Built in
    Mouse
    Touch pad
Try changing the extension from .bat to .cmd.
tried that still no luck. still giving me same results as the screenshot haha.
would this be something to do with windows itself or some sort of service within windows?
 

My Computer

System One

  • OS
    windows 8.1 and server 2012 R2
Try doing the following from a Command Prompt.

Type echo "taskkill /F /IM Steam.exe" > a.bat and press Enter.

Now run a.bat and see what happens. Trying to figure out if the corruption is occurring on the creation of the .bat file or on the execution.
 

My Computer

System One

  • OS
    Windows 10 Pro X64
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Lenovo IdeaCenter K450
    CPU
    Intel Quad Core i7-4770 @ 3.4Ghz
    Motherboard
    Lenovo
    Memory
    16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
    Graphics Card(s)
    Intel Integrated HD Graphics
    Sound Card
    Realtek HD Audio
    Monitor(s) Displays
    HP h2207
    Screen Resolution
    1680x1050@59Hz
    Hard Drives
    250GB Samsung EVO SATA-3 SSD;
    2TB Seagate ST2000DM001 SATA-2;
    1.5TB Seagate ST3150041AS SATA
    PSU
    500W
    Keyboard
    Wired USB
    Mouse
    Wired USB
    Internet Speed
    3GB Up, 30GB Down
    Browser
    SeaMonkey
    Antivirus
    Windows Defender; MBAM Pro
    Other Info
    UEFI/GPT
    PLDS DVD-RW DH16AERSH
Try doing the following from a Command Prompt.

Type echo "taskkill /F /IM Steam.exe" > a.bat and press Enter.

Now run a.bat and see what happens. Trying to figure out if the corruption is occurring on the creation of the .bat file or on the execution.

holy smoke it worked. what does that command work? "echo "taskkill /F /IM Steam.exe" > a.bat" and what does this mean theres corruption somewhere and do I have to do similar thing for all my other .bat files as well?


this is new thing i did, looks like I might have to do this for every .bat just to make sure it works, still wayyy better than not able to run the file at all. i have a.bat and a.cmd with same information but the new command you made me type is now a.bat, a.cmd is the old one i simply rename the file.

asdf.jpg

edit: so maybe creating .bat file with notepad.txt and changing extension isn't such a good idea afterall.. is that the cause?
 

My Computer

System One

  • OS
    windows 8.1 and server 2012 R2
I believe Notepad uses what they call a BOM or byte order mark. Ansi uses single byte characters so that problem doesn't come up. But with multibyte characters such as used in Unicode this can arise.

Try a different editor such as EditPad Lite 7. It is free.
 

My Computer

System One

  • OS
    Windows 8.0 x64
    Computer type
    Laptop
    System Manufacturer/Model
    Toshiba Satelite C55D-A Laptop
    CPU
    AMD EI 1200
    Memory
    4 gb DDR3
    Graphics Card(s)
    Raedon 340 MB dedicated Ram
    Monitor(s) Displays
    Built in
    Screen Resolution
    1366 x 768
    Hard Drives
    640 GB (spinner) Sata II
    Keyboard
    Built in
    Mouse
    Touch pad
I believe Notepad uses what they call a BOM or byte order mark. Ansi uses single byte characters so that problem doesn't come up. But with multibyte characters such as used in Unicode this can arise.

Try a different editor such as EditPad Lite 7. It is free.

yea you're right, found the problem is with encoding issue. a.cmd and a.bat have same content but the sizes are different. cmd is like 56 bytes where as .bat was like 26, only half the size. I used notepad++ to compared difference and found it was encoding, after switching encoding solved everything lol.
 

My Computer

System One

  • OS
    windows 8.1 and server 2012 R2
Glad you got it straightened out.
Like-Like-approved-agree-smiley-emoticon-001275-facebook.gif
 

My Computer

System One

  • OS
    Windows 8.0 x64
    Computer type
    Laptop
    System Manufacturer/Model
    Toshiba Satelite C55D-A Laptop
    CPU
    AMD EI 1200
    Memory
    4 gb DDR3
    Graphics Card(s)
    Raedon 340 MB dedicated Ram
    Monitor(s) Displays
    Built in
    Screen Resolution
    1366 x 768
    Hard Drives
    640 GB (spinner) Sata II
    Keyboard
    Built in
    Mouse
    Touch pad
Good job, nice to see things fixed.
 

My Computer

System One

  • OS
    Windows 10 Pro X64
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Lenovo IdeaCenter K450
    CPU
    Intel Quad Core i7-4770 @ 3.4Ghz
    Motherboard
    Lenovo
    Memory
    16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
    Graphics Card(s)
    Intel Integrated HD Graphics
    Sound Card
    Realtek HD Audio
    Monitor(s) Displays
    HP h2207
    Screen Resolution
    1680x1050@59Hz
    Hard Drives
    250GB Samsung EVO SATA-3 SSD;
    2TB Seagate ST2000DM001 SATA-2;
    1.5TB Seagate ST3150041AS SATA
    PSU
    500W
    Keyboard
    Wired USB
    Mouse
    Wired USB
    Internet Speed
    3GB Up, 30GB Down
    Browser
    SeaMonkey
    Antivirus
    Windows Defender; MBAM Pro
    Other Info
    UEFI/GPT
    PLDS DVD-RW DH16AERSH
thanks guys. i'll post a screen shot for who needs an answer in the future happen to be same issue as I am facing. but if not for your "echo > a.bat" command I would never have gotten one that works, hence never find the right encoding in notepad++ as i didn't have a pair of working/nonworking ones to compare with.
 

My Computer

System One

  • OS
    windows 8.1 and server 2012 R2
solved, look at screenshot below. use notepad++ to change encoding and it'll work. or use the "echo" function below to create a clean .bat file.

t.jpg

thanks to Ztruker "echo "taskkill /F /IM Steam.exe" > a.bat"
 

My Computer

System One

  • OS
    windows 8.1 and server 2012 R2
Back
Top