title: how to stop a batch script from renaming itself?
body: <p>Im trying to make a script that renames all files except itself in the folder the script is located in, how can i prevent this?</p>
  
  <p>I tried excluding all .bat files but this doesnt seem to work.</p>
  
  <pre><code>set /P name="New name: "
  set /A int= 1
  
  for %%I in ("%selectedDirectory%\*") do (
      echo %%I
      if not %%I == *.bat (
          echo %%I 
          ren %%I %name%!int!.* 
          set /A int += 1 
      )
  ) 
  </code></pre>