[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Create a list of variables via a wildcard

Posted on 2006-10-23
3
Medium Priority
?
170 Views
Last Modified: 2010-04-24
I would like to create some variables that would list 3-4 files with the same name, but have different extensions.  So the user can click on a file such as:  \\server\location\testfile.xpi and then I can get a list of all the files with the same name but have different extensions such as:
X=\\server\location\testfile.xpi
Y=\\server\location\testfile.zip
Z=\\server\location\testfile.lsi

I currently have my script setup to where the user can click on one filename and create the x variable, but not sure how I can automate it to add the other 2-3 variables.
Thanks, Chad
0
Comment
Question by:chadmanvb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 13

Expert Comment

by:newyuppie
ID: 17793491
there's the FileInfo class in system.IO, where you can separate filenames from extensions, or directory names, etc. its pretty useful
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 750 total points
ID: 17793587
See:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemiodirectoryinfoclassgetfilestopic2.asp

Strip off the extension and replace it with *:

    \\server\location\testfile.*

Pass that to GetFiles() and it will return the list you want...
0
 

Author Comment

by:chadmanvb
ID: 17800643
getfiles() worked great.  Thanks, Chad
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question