XP Batch File won't start

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
 
W

Wesley Vogel

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
 
P

Phil Robyn

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?
 
G

Guest

When I double click it opens the file in notepad.

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

Phil Robyn

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
 
W

Wesley Vogel

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
 
G

Guest

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
 
W

Wesley Vogel

Make that...

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

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
D

David Candy

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
 
G

Guest

Thanks Wesley.

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

Thanks everyone
 
W

Wesley Vogel

Keep having fun. :)

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top