So basically I want to create a batch script that can run any notepad file which the user specifies. I tried this…
@Echo Off
SET /P ANSWER=What is the name of the file to open?
IF /i (%ANSWER%)==('FIND /i "*.txt" %ANSWER%) (goto :Filename)
goto :exit
:Filename
Start *.txt
EXIT
:exit
ECHO FAILLLLLLLL
PAUSE
EXIT
The issue here is the first IF statement. I know its wrong. But, I don’t know how to specify the entry of any filename. A different way to do this task is also appreciated.
Thanks for help 🙂
If your goal is simply to open a file that the user specifies in Notepad, the following works for me in Windows 7: