How to replace the script name %~n0 with a string of "-" characters of length %~n0?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Locked
Message
Author
PiotrMP006
Posts: 31
Joined: 08 Sep 2017 06:10

How to replace the script name %~n0 with a string of "-" characters of length %~n0?

#1 Post by PiotrMP006 » 10 Jan 2024 02:07

Hi

How to replace the script name %~n0 with a string of "-" characters of length %~n0?

Code: Select all

ex. %~n0 = Test.bat

How do I change "Test.bat" to the string "---------" ?

Test.bat
--------

T3RRY
Posts: 250
Joined: 06 May 2020 10:14

Re: How to replace the script name %~n0 with a string of "-" characters of length %~n0?

#2 Post by T3RRY » 10 Jan 2024 03:39

PiotrMP006 wrote:
10 Jan 2024 02:07
Hi

How to replace the script name %~n0 with a string of "-" characters of length %~n0?

Code: Select all

ex. %~n0 = Test.bat

How do I change "Test.bat" to the string "---------" ?

Test.bat
--------

Isn't this essentially the same question you asked at viewtopic.php?f=3&t=10962&sid=a5ee30475 ... 272ec4dfac

Locked