windows - How to check if a file exists from inside a batch file -


this question has answer here:

i need run utility if file exists. how do in windows batch?

if exist <insert file name here> (     rem file exists ) else (     rem file doesn't exist ) 

or on single line (if single action needs occur):

if exist <insert file name here> <action> 

for example, opens notepad on autoexec.bat, if file exists:

if exist c:\autoexec.bat notepad c:\autoexec.bat 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -