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.
Page 1 of 1
Bat Script Explanation
#2
Posted 28 December 2007 - 11:34 PM
The script takes a file/folder as a parameter %1
It takes this parameter and sets it as a variable set test=%1
Then it performs a rename operation using the last 13 characters of the %test% variable. ren %1 APP_PROD_ABC_%test:~13%
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



Help
Back to top








