Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3458244
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:57:32+00:00 2026-05-18T09:57:32+00:00

About 3 days ago I asked a question, which can be found here: how

  • 0

About 3 days ago I asked a question, which can be found here:

how to replace a string on the second line in a text file using a batch file?

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.

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

attrib +h C:\script\%name%.txt

Would hiding a file with this command make it invisible to batch programs that are searching for it/call upon it?

Here’s a link to the file, “stringparsing.bat”: http://uploading.com/files/a1m1d2f4/stringparsing.bat/

If you could assist me in getting this program to carry out its task without any errors it would be greatly appreciated!

Here’s the “stringparsing.bat” file in full:

@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 > 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. > %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% >> %name%.txt 2> nul


echo %name% > 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=<Language_File.txt
timeout /t 4 /nobreak > nul
echo.
echo.
echo Language_File Loaded!
pause >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! > !name!.txt

pause >nul
TIMEOUT /t 5 /nobreak > 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 > nul





::(%xx%) -1  I/O Stream= "SHELL.dll" 
:: IF EXIST [&1[Parser_2009]] exit

Exit


:: #####################################################################################
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T09:57:33+00:00Added an answer on May 18, 2026 at 9:57 am

    You’ve got a few problems. First, the access denied problem is from you redirecting to a hidden file.

    echo %name% > Language_File.txt
    attrib +h Language_File.txt
    

    Note that the first time you run the script, it will work because Language_File.txt won’t exist and therefore won’t be hidden. The second time you run it, you’ll get access denied. I don’t know why Windows doesn’t let you do that. You can solve this problem in a couple ways.

    1. Save your file to the user’s temp directory. With this approach your directory won’t get cluttered.

    echo %name% > %TMP%\Language_File.txt
    

    2. Save your file to a subdirectory that you own so that it doesn’t clutter the script’s directory.

    if not exist workspace mkdir workspace
    echo %name% > workspace\Language_File.txt
    

    3. Unhide the file before you use it. Since the file may not exist the first time you run the script, perhaps you should only attrib -h if it exists.

    if exist Language_File.txt attrib -h Language_File.txt
    echo %name% > %TMP%\Language_File.txt
    attrib +h Language_File.txt
    

    4. Don’t use Language_File.txt at all! I don’t see why you need it. Just use variables to hold the name of the language file. In fact, you already have the name in %name%, right?

    Second, you should check the value of your variables to see what they really hold. When you load the contents of Language_File.txt into your variable, it’s loading all the contents. That includes the hidden newline characters \r\n, although the script seems to bring them into the variable as spaces. See:

    c:\batch\t>echo language file is loading now!
    language file is loading now
    C:\batch\t>set /p name= <Language_File.txt
    C:\batch\t>echo -%name%-
    -langfile  -
    

    If you echo %name% surrounded by hyphens, you can see that there are 2 spaces after it from (presumably) the newline characters. To solve this problem, you can use set to trim the trailing characters.

    C:\batch\t>echo language file is loading now!
    language file is loading now
    C:\batch\t>set /p name= <Language_File.txt
    C:\batch\t>set name=%name:~0,-2%
    C:\batch\t>echo -%name%-
    -langfile-
    

    In the second example, `%name% doesn’t have the hidden characters.

    Finally, you only need to use ! to access variables that you set inside the for loop. So all references to !name! should be %name% instead. That’s probably your “cannot find file” error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A couple of days ago I asked a question about how to replace and
I asked a question a couple days ago about creating INSERTs by running a
I asked a question a few days ago about how to customise the calendar
few days ago I asked here about implementing USB. Now, If I may, would
so I asked here few days ago about C# and its principles. Now, if
I'm using Notepad++ for python development, and few days ago I found out about
In response to a question I asked a few days ago, I'm attempting to
Guys I've asked few days ago a question and didn't have really time to
few days ago i asked about how to get all running processes in the
Lifehacker had a post a couple days ago asking people about the best mouse

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.