mahesh
mahesh

Reputation: 3217

Error while executing (.exe ) from windows command script (.cmd) file

I have the following syntax in the .cmd file, where PathList is console application with .exe as extension.

cd  D:\Sample
D:
PathList 2> file.txt

This syntax works fine if the file is saved with .bat as extension, but if save it with .cmd extension it throws error saying 'PathList' is not recognized as an internal or external command, operable program or batch file. Please can i know what is the issue with saving it with .cmd extension

Upvotes: 0

Views: 753

Answers (1)

Akash Yadav
Akash Yadav

Reputation: 2421

could you try shuffling the first two lines in case of CMD, i think its not able to navigate to that directory that we moved with CD

try this

D:
cd  D:\Sample
PathList 2> file.txt

Upvotes: 1

Related Questions