Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-23-2012, 11:09 AM
Too_Tall_Crown_Victoria Too_Tall_Crown_Victoria is online now
Registered User
 
Join Date: 01-15-2003
Posts: 44
Locate does not work well for directory with wildcards

I am using VBP 8.0 and trying to write a script to search a directory which contains a number of other directories in it. I want to search these based on a wildcard and process only the folders that match.

For example:

C:\Temp\A_123_20120722\
C:\Temp\A_123_20120723\
C:\Temp\B_234_20120722\
C:\Temp\B_234_20120723\

I would like to find and delete any folder matching C:\Temp\*_%T_DATE% where %T_DATE% = 20120722

Thanks
Reply With Quote
  #2  
Old 07-23-2012, 11:32 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
See the attached sample.

Code:
7/23/2012 10:30:53 AM: -------------------- Starting Build: 'DelFolders.bld' --------------------
7/23/2012 10:30:53 AM: Building project step 1 - Project steps...
7/23/2012 10:30:53 AM: Building project step 2 - Create test files...
7/23/2012 10:30:53 AM: Building project step 3 - Write File...
Creating file d:\Temp\test\A_123_20120722\test.txt
7/23/2012 10:30:53 AM: Building project step 4 - Write File...
Creating file d:\Temp\test\A_123_20120723\test.txt
7/23/2012 10:30:53 AM: Building project step 5 - Write File...
Creating file d:\Temp\test\B_123_20120722\test.txt
7/23/2012 10:30:53 AM: Building project step 6 - Write File...
Creating file d:\Temp\test\B_123_20120723\test.txt
7/23/2012 10:30:53 AM: Building project step 7 - Before...

Directory of d:\Temp\test\

         0 File(s)                     0 bytes

Directory of d:\Temp\test\A_123_20120722

07/23/2012 10:30:53 AM                 4                   test.txt
         1 File(s)                     4 bytes

Directory of d:\Temp\test\A_123_20120723

07/23/2012 10:30:53 AM                 4                   test.txt
         1 File(s)                     4 bytes

Directory of d:\Temp\test\B_123_20120722

07/23/2012 10:30:53 AM                 4                   test.txt
         1 File(s)                     4 bytes

Directory of d:\Temp\test\B_123_20120723

07/23/2012 10:30:53 AM                 4                   test.txt
         1 File(s)                     4 bytes

      Total Files Listed:
         4 File(s)                    16 bytes
7/23/2012 10:30:53 AM: Building project step 8 - Delete folders...
Delete files in folder 'd:\Temp\test\'...
A_123_20120722\test.txt
B_123_20120722\test.txt
2 file(s) deleted
7/23/2012 10:30:53 AM: Building project step 9 - After...

Directory of d:\Temp\test\

         0 File(s)                     0 bytes

Directory of d:\Temp\test\A_123_20120723

07/23/2012 10:30:53 AM                 4                   test.txt
         1 File(s)                     4 bytes

Directory of d:\Temp\test\B_123_20120723

07/23/2012 10:30:53 AM                 4                   test.txt
         1 File(s)                     4 bytes

      Total Files Listed:
         2 File(s)                     8 bytes
7/23/2012 10:30:53 AM: Build successfully completed (elapsed = 00:00:00).
Attached Files
File Type: bld DelFolders.bld (2.4 KB, 1526 views)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 11:37 PM.


Copyright © 1999-2023 Kinook Software, Inc.