Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Batch does not recognize echo

Well I got this errormessage when I load my bacth and I can't figure out what I'm doing wrong.

C:\Windows\system32>´╗┐@echo off
´╗┐@echo gjenkjennes ikke som en intern eller ekstern kommando,
kjørbart program eller satsvis fil.

It says "command not recognize"

And here is a sample of my code

@echo off
PING www.vg.no>nul
if errorlevel 1 goto nonet
if errorlevel 0 goto gotnet
goto END
:nonet
echo == Maskinen er ikke tilkoblet wlan.Dette programet krever nett og vil derfor avsluttes. 
timeout 5>null
exit

:gotnet
echo == Maskinen er tilkoblet nett. 
:END
PING ping 192.168.1.241>nul

if errorlevel 0 goto gotlocal
if errorlevel 1 goto nolocal

:nolocal
echo == Skript finner ikke server. Program avsluttes.
timeout 5>nul
Exit


:gotlocal
@echo [WLAN CHECK][:)                      ]
@timeout 1 >nul
cls
@echo [WLAN CHECK][::)                     ]`
like image 268
Stian Størstfeskar Andersen Avatar asked Mar 17 '23 15:03

Stian Størstfeskar Andersen


1 Answers

It seems that you saved yor batch file with a UTF8 BOM (EF BB BF).
Open it with a text editor and save it as ANSI-Text file

like image 66
jeb Avatar answered Mar 23 '23 01:03

jeb