TechKnow

Author Topic: [BAT] stripping the last character out of a file  (Read 1412 times)

0 Members and 1 Guest are viewing this topic.

Offline HcH

  • TechKnow Owner, Ethical Hacker
  • Administrator
  • Uber Member
  • *****
  • Posts: 9936
  • Karma: +2284/-111
[BAT] stripping the last character out of a file
« on: November 22, 2011, 10:49:11 PM »

Easy but really handy little trick:

set STRiP=%systemdrive%1234567
echo %STRiP:~0,-4%

will give:

C:123

The -4% is the number of to remove characters.