XP Batch File won't start

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have built a simple batch file called Test.bat with the following line

Echo Test Running

I try to execute this from the cmd prompt in Windows XP

The following message is returned

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

This program will work on other xp machines.

I am logged in as administrator

TIA

Peter
 
Does Test.bat work when you double click it?

If it does, open a command prompt, type: path and hit your Enter key.

Now, move or copy Test.bat to one of the folders that is listed in your
PATH.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
Peter said:
I have built a simple batch file called Test.bat with the following line

Echo Test Running

I try to execute this from the cmd prompt in Windows XP

The following message is returned

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

This program will work on other xp machines.

I am logged in as administrator

TIA

Peter

Is Test.bat in a directory in the PATH?
 
When I double click it opens the file in notepad.

I tried moving the file to a pathed folder. No change
 
Peter said:
When I double click it opens the file in notepad.

I tried moving the file to a pathed folder. No change

C:\cmd>assoc /?
Displays or modifies file extension associations

ASSOC [.ext[=[fileType]]]

.ext Specifies the file extension to associate the file type with
fileType Specifies the file type to associate with the file extension

Type ASSOC without parameters to display the current file associations.
If ASSOC is invoked with just a file extension, it displays the current
file association for that file extension. Specify nothing for the file
type and the command will delete the association for the file extension.

C:\cmd>assoc .bat
..bat=batfile
 
Sounds like your .bat file associons are messed up.

If you right click a .bat file You should see:
Open
Edit
Print

Open should be in *BOLD* letters.

Right clicking and selecting Edit should open a .bat file in Notepad, not
double clicking.

Go here....
Windows® XP File Association Fixes
Copyright 2003 - Doug Knox
http://www.dougknox.com/xp/file_assoc.htm

Read the instructions. Then get...

Batch File Association Fix (Restore the default associations for BAT files)

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
assoc bat returns

..bat=batfile


Phil Robyn said:
Peter said:
When I double click it opens the file in notepad.

I tried moving the file to a pathed folder. No change

C:\cmd>assoc /?
Displays or modifies file extension associations

ASSOC [.ext[=[fileType]]]

.ext Specifies the file extension to associate the file type with
fileType Specifies the file type to associate with the file extension

Type ASSOC without parameters to display the current file associations.
If ASSOC is invoked with just a file extension, it displays the current
file association for that file extension. Specify nothing for the file
type and the command will delete the association for the file extension.

C:\cmd>assoc .bat
..bat=batfile

--
Phil Robyn
University of California, Berkeley
 
Make that...

Sounds like your .bat file *associations* are messed up.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
I get this message if the file can't be found. If the bat file is unicode I get
"<an unprintable character from unicode header>E" is not recognised etc
 
Thanks Wesley.

All fixed after running ougknox.com/xp Batch File association and rebooting.

Thanks everyone
 
Back
Top