Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Need help with extracting 4 digits from the directory/folder name

Reply
 
Old 02-13-2009   #1 (permalink)
sa


 
 

Need help with extracting 4 digits from the directory/folder name

I have a variable folderP set to various paths values. I need to
extract the 2nd, 3rd, 4th and 5th charcters from it as explained with
an example below.

Here's the code i use:
-------------------------------
folderP=Application.PrimaryDirectory
For Ex.
folderP is set to C:\temp\21070Ax12K7. I need the 1070 from that
value.

Another Ex.
folderP set to Z:\NPBDArchive\PCDesign\ajackr\21062Axp22k745 - in
this case I need to extract the value 1062.

Also the primary directory names always start with a 2 followed by 4
digits and then an A. Is there a good way to get these values.


Thanks

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Vista x86 program folder not showing in directory Vista file management
When I minimize a folder, it shows whole directory Vista General
Missing 2 digits on product key sticker Vista installation & setup
How do I change de directory for my user folder?? Vista General
Moving a directory / file from 1 location to another folder Vista file management


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46