0
votes

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

1
What directory is PathList stored in? If it's not in your Sample subdir, and not anywhere in your system %PATH%, the error you're getting is normal.Marc B
Thanks for the reply , ya i have my PathList.exe file in the D:\Sample directory itself, then how come its fine when i save with .bat as extensionmahesh

1 Answers

1
votes

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