Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Win 7 64 *.bat fail can't even execute echo

04 Mar 2013   #1
sc00b

Windows 7 64
 
 
Win 7 64 *.bat fail can't even execute echo

Context : For my blind father, i wrote a *.bat file that would copy audiobook (mp3 files) from a CD to a memory card. Worked fine on his windows XP computer, when he switched to Windows 7 it worked OK after minors adjustments.

New Problem : When I got back home, I was informed that the *.bat no longer work.
After investigations I realise that even REM or ECHO failed to execute (inside the bat file).

I've search the internet for a solution but couldn't find anything :

In order to define my problem, I've made a simple bat with just an echo "hello world", ran it inside cmd got the following error :

Code:
C:\Users\JP\Documents>test.bat

C:\Users\JP\Documents>■e
'■e' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
Translated from french it's the well known error message : '■e' not an internal or external command ...

Since echo work fine as a simple command (in CMD) it does not come from a path error.

Can you give me a clue about what is wrong on my father's computer ?


Secondary question :
With windows XP I used to play sound so my father would know what has to be done next. since sndrec32 was removed from windows 7 does anyone know of an other way to play sound ?


My System SpecsSystem Spec
.
04 Mar 2013   #2
Neutron16

Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
 
 

For first issue, please check path variable. Just type PATH in cmd. Please post result.
I would scan for malware just in case.

As for second issue, you can use something like this in your bat file.
Quote   Quote: Originally Posted by http://superuser.com/questions/101974/play-a-sound-maybe-wav-from-windows-line-command
powershell -c (New-Object Media.SoundPlayer "C:\Windows\Media\notify.wav").PlaySync();
My System SpecsSystem Spec
04 Mar 2013   #3
oreo27

Windows 7 Ultimate x64 Service Pack 1
 
 

May I see the source of your batch file?
My System SpecsSystem Spec
.

04 Mar 2013   #4
sc00b

Windows 7 64
 
 

@Neutron16
Thank you for taking the time to look into it.
As stated before I assumed the path was ok since echo worked with CMD and not in the *.bat, on the other hand I have no idea what errors to look for in the path, so here it is
Code:
C:\>path
PATH=c:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;
C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
@oreo

at the moment even at *.bat with just this line is not working
Code:
ECHO "hello world"
My main program is still a work in progress (not very clean, and commented in french)
Code:
REM LecteurCD selection du lecteur d'origne des MP3
set LecteurCD=b
REM Destination Destination des livres 
set Destination=g:\$VROtherBooks\

set var="NOK"


for /f "tokens=*" %%i in ('dir /b /A:D %LecteurCD%:\') do (

set var="OK"

%LecteurCD%:
cd %LecteurCD%:/%%i



if '%%i' equ "mp3" GOTO bad
if "%%i" equ "Mp3" GOTO bad
if "%%i" equ "MP3" GOTO bad

set Livre=%%i

echo config livre = %livre%
goto Copy
)

if %var% equ "NOK" GOTO bad


:eof
REM Start /min sndrec32 /play /close %SystemRoot%\Media\tada.wav
Exit 5

:bad
title entrez titre du livre
REM Start /min sndrec32 /play /close %SystemRoot%\Media\ringin.wav
%LecteurCD%:
set /p Livre= Titre du livre 
echo titre du livre %Livre%
goto Copy

:Copy 
title Copie livre %%i
echo Copy [%Livre%] To ["%Destination%%Livre%"]


REM Start /min sndrec32 /play /close %SystemRoot%\Media\notify.wav
xcopy /v /y /I *.mp3 "%Destination%%Livre%"

goto eof
Other informations :
the batch was working at Xmas, no new program installed but some update were done.
I haven't confirmed that the errors are the same but some other people using my script (Variables allow me to quickly give it to other users) report suddently not being able to use the script.
My System SpecsSystem Spec
04 Mar 2013   #5
oreo27

Windows 7 Ultimate x64 Service Pack 1
 
 

Well, it's certainly a lot more complicated than I imagined.

In any case, this output is somewhat strange to me.

Code:
C:\Users\JP\Documents>■e
'■e' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
It seems the command is not properly executed. Here's a crazy idea, can you try this Hello World batch attached to this post?

I'm trying to figure out if it has anything to do with the encoding of your batch file.


Attached Files
File Type: zip Test.zip (251 Bytes, 2 views)
My System SpecsSystem Spec
04 Mar 2013   #6
sc00b

Windows 7 64
 
 

@oreo27
You seem to be on to something since your *.bat file run OK, but when I copy/paste the command into my *.bat file it give me the error message.

I'm using a simple notepad to do it so I have no idea where the encoding/saving problem come from :/

As for my main program, it's probably not the most efficient way to do things, but it grew with every case I encounder, in order to make it very simple for the user : this sound mean type the title, this one mean it's copying and the last sound mean copy finished, next book please ^^
My System SpecsSystem Spec
04 Mar 2013   #7
oreo27

Windows 7 Ultimate x64 Service Pack 1
 
 

Quote   Quote: Originally Posted by sc00b View Post
@oreo27
You seem to be on to something since your *.bat file run OK, but when I copy/paste the command into my *.bat file it give me the error message.

I'm using a simple notepad to do it so I have no idea where the encoding/saving problem come from :/

As for my main program, it's probably not the most efficient way to do things, but it grew with every case I encounder, in order to make it very simple for the user : this sound mean type the title, this one mean it's copying and the last sound mean copy finished, next book please ^^
Well, to be honest, I think it has to do with Windows' language settings. But this is just purely speculation and if someone else can jump in and explain it, that'd be great.

I personally use Notepad++ Home for coding in batch. The default options work fine for me. Can you try using that and see if you end up with the proper result?
My System SpecsSystem Spec
04 Mar 2013   #8
sc00b

Windows 7 64
 
 

OK seems to be working. Thank you very much Oreo27 for the quick response, now I just need to add the sound (thanks Neutron16).

I will post the *.bat once it's completed if you recon it might help someone, someday.
My System SpecsSystem Spec
04 Mar 2013   #9
oreo27

Windows 7 Ultimate x64 Service Pack 1
 
 

Quote   Quote: Originally Posted by sc00b View Post
OK seems to be working. Thank you very much Oreo27 for the quick response, now I just need to add the sound (thanks Neutron16).

I will post the *.bat once it's completed if you recon it might help someone, someday.
No worries. Glad it works.
My System SpecsSystem Spec
04 Mar 2013   #10
Neutron16

Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
 
 

Quote   Quote: Originally Posted by oreo27 View Post
if someone else can jump in and explain it, that'd be great
I was able to recreate the error. That happens when you save your bat file in notepad in UTF-8 encoding instead ANSI. You need to save it again in ANSI.

Notepad would ask for encoding change if it finds that file contains any letters with accents for example (é, è, ê etc.).
My System SpecsSystem Spec
Reply

 Win 7 64 *.bat fail can't even execute echo




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Echo-y sound
On my new Windows 7 tower computer, when I plug in speakers or headphones, everything sounds like the bottom of a well. How can I get rid of that? (Realtek High Definition Audio) (Windows Home Premium SP 1) Thanks,
Sound & Audio
Sound has a little echo
My sound in Windows 7, windows media player, has a little echo. It's like my speakers are at the bottom of a well. Any idea on how to make the sound normal? I have the newest drivers installed. Thanks
Sound & Audio
echo
when i listen to music or watch a movie, then the sound just echos... is the problem in my headphone because speakers are working fine..?
Sound & Audio
Microphone with echo
Well guys, i use microphone to play, but when people talk something in TS/Ventrilo(voice comunication programs) people can her themselves cause my microphone is with echo. But this doesn't happen when i use windows xp with the same phone, does any1 know why?
Sound & Audio
ECHO echo sounds
Hi My only poroblem with RC7100 revolves around the fact that through my speakers, when playing music, I get an "echo-ey" sound....I thought it was because I had placed my microphone too close to the speakers and/or had my microphone turned up too loud (no such problem when set up the same when...
Sound & Audio


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 21:48.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App