|
#1
|
|||
|
|||
How to retrieve and parse current directory?
Basically what I'd like to do is retrieve part of the current directory name. For example, if the directory (that the Visual Build Pro .bld file exists in) is
C:\whatever\dir 1234 abcd what I'd like to get is "1234". So first, I need a way to retrieve the dir name and then I need a way to parse it. Thanks. |
#2
|
|||
|
|||
[vbld_FSO.GetBaseName("%PROJDIR%")]
will give you the directory name of the current .bld file. It's not clear exactly how you want to parse the value (first item found after a space, first set of digits, etc.). To retrieve the first value between spaces, use [Split(vbld_FSO.GetBaseName("%PROJDIR%"))(1)] The code above assumes VBScript is set as the default script language. |
#3
|
|||
|
|||
OK thanks. So 2 more questions.
What step type would I create to put your code in? For parsing, it looks like it can be this simple. blah blah blah 1.2.3.4 I want 1.2.3.4, so it could be as simple as getting the last "token", or whatever comes after the last space. |
#4
|
|||
|
|||
Quote:
Quote:
|
|
|