title: "access denied" error message for a text file i just made?
body: <p>About 3 days ago I asked a question, which can be found here: </p>
  
  <p><a href="https://stackoverflow.com/questions/4310472/how-to-replace-a-string-on-the-second-line-in-a-text-file-using-a-batch-file">how to replace a string on the second line in a text file using a batch file?</a> </p>
  
  <p>I'm converting the letters in a text file into their respective numbers. I'm getting error messages such as "Access denied" and "Cannot locate this file" -- but the same batch file that's giving me all these errors is also the one that made these text files to begin with! So it should be in the same directory as the batch file itself (unless specified otherwise), right? I even went to that folder and checked, and they're there. </p>
  
  <p>I did add a small script to hide the files after they were created so that it wouldn't look so cluttered up. I did this by using </p>
  
  <pre><code>attrib +h C:\script\%name%.txt
  </code></pre>
  
  <p>Would hiding a file with this command make it invisible to batch programs that are searching for it/call upon it?</p>
  
  <p>Here's a link to the file, "stringparsing.bat": <a href="http://uploading.com/files/a1m1d2f4/stringparsing.bat/" rel="nofollow noreferrer">http://uploading.com/files/a1m1d2f4/stringparsing.bat/</a> </p>
  
  <p>If you could assist me in getting this program to carry out its task without any errors it would be greatly appreciated!</p>
  
  <p>Here's the "stringparsing.bat" file in full:</p>
  
  <pre><code>@echo off
  setlocal enabledelayedexpansion 
  title BETA
  cls
  cd C:\script\st
  echo.
  echo.
  echo.
  echo      Setting Variables...
  echo      Loading Language Database...
  
  :: ###################################################################################
  ::    CALLING VARIABLE DATABASE CALLING VARIABLE DATABASE CALLING VARIABLE DATABASE
  :: ###################################################################################
  
  
  
  
  TIMEOUT /t 5 /nobreak &gt; nul
  
  goto MAIN
  
  :MAIN
  set foo=0
  cls
  echo.
  echo.
  echo.
  echo.
  echo            ===================================
  echo             #################################        
  echo             #######     Main Menu:    #######
  echo             #################################
  echo            ===================================
  echo.
  echo.
  echo             1.) Create New Language File...
  echo.
  echo             2.) Load Existing Lanuage File...
  echo.
  echo             3.) Settings...
  
  echo ---------------------------------------------------------
  
  SET /p CHOICE= Select a Function:
  IF %CHOICE%== 1 GOTO CREATE
  IF %CHOICE%== 2 GOTO LOAD
  IF %CHOICE%== 3 GOTO SETTINGS
  
  GOTO MAIN
  
  :CREATE
  cls
  title Step 1
  echo.
  echo.
  echo.
  echo         =================================================================================
  echo.
  set /p name=  please type a name for your new language file:
  echo.
  echo         =================================================================================
  cls
  echo. &gt; %name%.txt
  echo.
  echo.
  echo.
  echo        ==============================================================
  echo        ##############################################################
  echo        #============================================================#
  echo        #                                                            #
  echo        # - After you hit enter you will be redirected               #
  echo        #   to a Live Typer. so anything you type into               #
  echo        #   it will be sent to %name%.txt.                           #
  echo        #                                                            #
  echo        #                                                            #
  echo        # - Next, select load language File For Encoding!            #
  echo        #                                                            #
  echo        #============================================================#
  echo        ##############################################################
  echo        ==============================================================
  
  set /p line1= :
  echo %line1% &gt;&gt; %name%.txt 2&gt; nul
  
  
  echo %name% &gt; Language_File.txt
  attrib +h Language_File.txt
  set /a foo+ =1
  )
  echo.
  echo ==========================================================
  
  goto LOAD
  
  
  
  :LOAD
  set /a foo+ =1
  IF %foo%== 2 goto loadexternal
  goto LOAD23
  
  :loadexternal
  echo.
  echo language file is loading now!
  set /p name=&lt;Language_File.txt
  timeout /t 4 /nobreak &gt; nul
  echo.
  echo.
  echo Language_File Loaded!
  pause &gt;nul
  goto LOAD23
  
  :LOAD23
  cls
  echo.
  echo.
  echo.
  echo.
  echo.
  echo        Encoding Your Language File... Please Wait... 
  echo.
  echo.
  echo.
  
  for /f "delims=" %%i in (!name!.txt) do ( 
  echo translating "%%i"
  set var=%%i 
  set var=!var:a=1 ! 
  set var=!var:b=2 ! 
  set var=!var:c=3 ! 
  set var=!var:d=4 ! 
  set var=!var:e=5 ! 
  set var=!var:f=6 ! 
  set var=!var:g=7 ! 
  set var=!var:h=8 ! 
  set var=!var:i=9 ! 
  set var=!var:j=10 ! 
  set var=!var:k=11 ! 
  set var=!var:l=12 ! 
  set var=!var:m=13 ! 
  set var=!var:n=14 ! 
  set var=!var:o=15 ! 
  set var=!var:p=16 ! 
  set var=!var:q=17 ! 
  set var=!var:r=18 ! 
  set var=!var:s=19 ! 
  set var=!var:t=20 ! 
  set var=!var:u=21 ! 
  set var=!var:v=22 ! 
  set var=!var:w=23 ! 
  set var=!var:x=24 ! 
  set var=!var:y=25 ! 
  set var=!var:z=26 ! 
  
  echo !var! 
  ) 
  
  echo !var! &gt; !name!.txt
  
  pause &gt;nul
  TIMEOUT /t 5 /nobreak &gt; nul
  
  goto MAIN
  
  
  :END
  cls
  title SHUTTING DOWN...
  echo.
  echo.
  echo.
  echo            Terminating service stream...
  echo.
  echo.
  echo.
  echo.
  echo            Done! Thank you for using this program!
  TIMEOUT /t 5 /nobreak &gt; nul
  
  
  
  
  
  ::(%xx%) -1  I/O Stream= "SHELL.dll" 
  :: IF EXIST [&amp;1[Parser_2009]] exit
  
  Exit
  
  
  :: #####################################################################################
  </code></pre>