Windows - How to get a variable substring in a for loop

ShadowTek

New Member
Reaction score
23
This regards code used in the Windows command line.

I know how to pull a substring out of a variable, but I don't know how
to get a substring out of a variable in a for loop.

When I try the following command...

Code:
   for %G in (Input_Files\*) do echo %G:~12%

...I get this:

Code:
   Input_Files\New Text Document.txt:~12%

But what I am trying to get is this:

Code:
  New Text Document.txt

What is wrong with this?
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top