Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello, Ive been having issues trying to replace single text, this question has been answerd before but it seems to remove all text before it deaming the code usless
Im trying to get the users to input something %a% which before replaced is n1
:ADD1
cls
Find /V n1 < Myfile.bat > %TEMP%.\Myfile.tmp
Echo %a% >>%TEMP%.\Myfile.tmp
Copy %TEMP%.\Myfile.tmp Myfile.bat
Del %TEMP%.\Myfile.tmp
clssection with n1
note: N1 and N2 are all I am wanting to replace with %a% and %b% but when a user inputs something it finds the N1 and replaces everything before it aswell
ren n1 "control panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren n2 "control panel1.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control panel1.{21EC2020-3AEA-1069-A2DD-08002B30309D}"thanks
Duke

You got me mystified.
Maybe post a before and after example.
=====================================
If at first you don't succeed, you're about average.M2

I'm getting the user to input something, that input replaces one word in a string which is in the same or batch file
cls
@echo off
:NAME1
cls
echo ________________________________________________________________________________
set /p a="First Folder's name that you want to hide: "
echo ________________________________________________________________________________
echo so you want to be able to hide %a% yes or no?
echo ________________________________________________________________________________
pause > nul
set/p "input=>"
if %input%==N goto NAME1
if %input%==n goto NAME1
if %input%==no goto NAME1
if %input%==Y goto ADD1
if %input%==y goto ADD1
if %input%==yes goto ADD1:ADDAN1
echo ________________________________________________________________________________
echo Would you like to add another Hideable folder yes or no?
echo ________________________________________________________________________________
pause > nulset/p "input=>"
if %input%==N goto END
if %input%==n goto END
if %input%==no goto END
if %input%==Y goto ADDAN1
if %input%==y goto ADDAN1
if %input%==yes goto ADDAN1
:ADD1
cls
Find /V n1 < Myfile.bat > %TEMP%.\Myfile.tmp
Echo %a% >>%TEMP%.\Myfile.tmp
Copy %TEMP%.\Myfile.tmp Myfile.bat
Del %TEMP%.\Myfile.tmp

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |