The use of blank at the beginning, extension for set / p (without LineFeed)
Posted: 25 Aug 2017 05:26
Hello,
I'm at the beginning flown over the blank - said Set /p. Now they come back.
Look at it and try it out.
PS
uhhhmg ... You must fill in self the TAB into this script
Phil
I'm at the beginning flown over the blank - said Set /p. Now they come back.
Look at it and try it out.
Code: Select all
@echo off
:: This batch will allow the use of leading spaces as well as TAB at the beginning
:: of the line to start an endless line with these characters as well as to write
:: them again. Then set / p "= following text without new line" as usual used to
:: write the rest of the text into this line.
::
:: Please note the use of the characters from the command: "prompt /?"!
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
setlocal
if :%1 == :print shift &goto :print
rem To execute an externally called command, which is enclosed in quotation marks
rem and quoted parameters (for / f ... in (cmd / c; cmd / k), the
rem first token is executed with a command that does not require quotation marks.
cmd /c if . equ . "%~f0" print " please Input "
set /p"input=& pess Enter:
cmd /c if . equ . "%~f0" print " "
echo %input%
set "output=%userprofile%\desktop\outputfile.txt"
set "LeadingSpace=cmd /c if . equ . "%~f0" print "
>"%output%" (
%LeadingSpace% " "
<nul set /p"=endless Line begins with Space Space End with TAB TAB"
%LeadingSpace% " "
)
notepad "%output%"
echo End
pause
exit /b
:print
rem Please note that this function/batch can NOT be started with a call.
rem Since it terminates the calling batch.
rem Usage: cmd /c if. equ . "Path\batchname" "whiteSpaces ..."
@echo on
@(
setlocal
set "prompt=%~1"
)
%== !required this is an empty Line, do not remove! ==%
@( echo off
PS
uhhhmg ... You must fill in self the TAB into this script
Phil