MSFN Forum: Bat Script Explanation - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Bat Script Explanation Rate Topic: -----

#1 User is offline   kodyleonard 

  • Newbie
  • Group: Members
  • Posts: 11
  • Joined: 09-October 07

Posted 28 December 2007 - 04:49 PM

Can someone explain the details of the following script to me?

set test=%1
ren %1 APP_PROD_ABC_%test:~13%

Mostly I'm curious what the ":~13% is doing. (yes I'm pretty new at this)

Thanks.


#2 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,118
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 28 December 2007 - 11:34 PM

The script takes a file/folder as a parameter %1
e.g. C:\APath\ADir\AFilename.ext

It takes this parameter and sets it as a variable set test=%1
set test=C:\APath\ADir\AFilename.ext

Then it performs a rename operation using the last 13 characters of the %test% variable. ren %1 APP_PROD_ABC_%test:~13%
ren C:\APath\ADir\AFilename.ext APP_PROD_ABC_AFilename.ext


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy