I know that we can convert it by using notepad. But for understanding the purpose of Batch Coding you can try this. This code changes the file extension of C++ (.cpp) to Text (.txt). So, we can assume that your file gets converted into text file.
CODE
@echo off Set /P userin=Enter the File name ECHO file name is =%userin% pause: set str1=%userin:.cpp=% echo.%str1% set "str2=%str1%.txt echo.%str2% pause: Press any key to convert it into Text file COPY %userin% %str2% pause:
Save this code with .bat extension. When you run this code, use the whole path specifying the drive later also.
No comments:
Post a Comment