Welcome, Guest. Please Login
vTask Homepage
 
 
Home Help Search Login


Page Index Toggle Pages: 1
Send Topic Print
Get the inner most folders paths (Read 313 times)
waheed
Advanced Member (60+)
*
Offline



Posts: 64
Get the inner most folders paths
May 27th, 2010 at 11:47pm
 
This example will go through a directory tree and stores a list of the inner most folders in a text file.

VXM Script:   (Copy and Paste into vTask)
<step>
<action>Comment</action>
<comment>This script will go through all folders recursively and gives you a list of the inner most folder names. </comment>
</step>
<step>
<action>Start Folders Loop</action>
<text>C:\Downloads\*</text>
<options>Recursive</options>
<output value="%folderName">Variable</output>
<comment>&lt;---- Change here</comment>
</step>
<step>
<action>Comment</action>
<indents>1</indents>
<comment>See how many folders inside the current folder.</comment>
</step>
<step>
<action>Count Files/Folders</action>
<text>%folderName\*.*</text>
<options>Folders</options>
<indents>1</indents>
<output value="%folderCount">Variable</output>
</step>
<step>
<action>Comment</action>
<indents>1</indents>
<comment>Does this folder has no sub-folder, then it IS the inner most folder.</comment>
</step>
<step>
<action>IF Expression</action>
<text>%folderCount = 0</text>
<indents>1</indents>
</step>
<step>
<action>Write/Create File</action>
<text>%folderName{newline}</text>
<value1>c:\folderNames.txt</value1>
<value2>-1</value2>
<indents>2</indents>
<comment>&lt;---- Change here</comment>
</step>
<step>
<action>END IF</action>
<indents>1</indents>
</step>
<step>
<action>NEXT LOOP</action>
</step>

Back to top
 
 
IP Logged
 
vTask Support
Moderator
*
Offline



Posts: 3596
Tucson, AZ
Re: Get the inner most folders paths
Reply #1 - May 28th, 2010 at 1:00pm
 
Works great, thanks for the useful submission.

...
Back to top
 

Thank you for using vTask Studio!
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print