title: writing program in batch script for a editing tool?
body: <p>My assignment is to create a editing tool that saves before editing. What I need to do is to make the user enter filename. If the file exists in the directory, it should make a backup with an extension of .bak. in the directory and then go on to editing it. If it doesn't exist, then it wont create a back up </p>
  
  <p>Here's what I've done but I'm unsure if this is correct:</p>
  
  <pre><code>:: turn the echo off
  @echo off
  :: ask the user to enter a filename then store it in a variable FILE 
  set /p FILE= What File Do You Wish to Edit? 
  :: check if the FILE exists 
  if EXIST %FILE (
  :: back it up 
  copy %A%A.bak) 
  :: to open file use notepad 
  notepad %A
  </code></pre>