简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM