o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

[2008] Deleting directory (with wildcard) -

I need to be able to delete all files and folders/subfolders within a specified directory, using a wildcard - does anyone know how I can use a wildcard in my code below?

Code:
My.Computer.FileSystem.DeleteDirectory(sFolderPath, Microsoft.VisualBasic.FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.DeletePermanently)
Eg: I want to delete the following directories & their subfolders:

c:\temp\test_xxx_123
c:\temp\test_xxx_456
c:\temp\test_xxx_789
c:\temp\test_xxx_012
c:\temp\test_xxx_345

However, I don't want to delete anything in c:\temp\ that doesn't contain "_xxx_" in the middle of the folder name.

In short, I need the VB equivalent (using my code above) for...

DEL c:\temp\*_xxx_*

(Except that DOS command doesn't work either, cos XP post SP2 doesn't delete subfolders by default, hence my need for a coded app).

Thanks.

 

[2008] Deleting directory (with wildcard) -
I need to be able to delete all files and folders/subfolders within a specified directory, using a wildcard - does anyone know how I can use a wildcard in my code below? Code: My.Computer.FileSystem.DeleteDirectory(sFolderPath, Microsoft.VisualBasic.FileIO.UIOption.OnlyErrorDia


Deleting a full directory -
Directory.Delete only deletes a directory if it's not empty. How can I delete a full directory? deleting each single file/sub dirs in the directory seems a little crazy


anyway for a user to supply a wildcard -
I am looking for a way that a user can supply a wildcard to define certian files that he/she wants from a directory. dlgCommonDialog.ShowOpen allows the user to choose one file, BUT how does the user supply a wildcard so that, for example, they can choose every *.txt file within a dir


Folder Wildcard -
Iam trying to search a sub directory and copy a folder when only knowing the first 3 numbers of the sub directory name. EG: I know the folder has 123 in its name string but it will actually be named: 123_CouldBeAnythingHere I tried some example wildcard characters form various


FileSystemObject or FileCopy *RESOLVED* -
My program creates a sub-directory then copies (typically about 6) files to it. All the file have the same extension so a wildcard could be used. Would you loop through the files and copy them with FileCopy or Would you use FileSystemObject.CopyFile and a wildcard?


deleting directories -
When using the rmdir function, an error is generated if the directory that you are attempting to delete contains any files or sub directories. Is there any way of automatically deleting a direcoty and all its sub directoies (i am aware of how to use kill c:\directory\*.*)?


Wildcard List -
Hi all, I want to check whether the entered string in a Text box is valid wildcards(This is used in MS word.If the user selects the Wildcards in the Find and Replace option, Entereing a non wildcard will give messages that invalid wildcard usage.How can I implement this in


Deleting a directory -
When I have had to use code to delete all files in a particular directory, I have made my program select each file 1 by 1 and go down the file list deleting them, this is ok for small directories but for larger ones it takes quite a long time, I was wondering is there a way to get rid


Find out if directory exist -
How do I find out if a directory exist without using filesystemobject. The directory might be empty so I cant make a wildcard search in it for files. GunYan


Oracle wildcard -
I have a field in an oracle db of datatype VARCHAR2(24) (alphanumeric) I amy trying to extract records where the above field is a 6 digit numeric e.g. 168497 I need this 568478 I need this SWTA-HGT Don't need this 12476 Don't need this In MS Acc


Using wildcards -
I am using M$ Access 2002 and the query builder/forms to run this. I am trying to do a query based off of several fields on a form. the query I am running looks at every one of these, and if the field in the table, matches the one selected on the form, then it displays it. What I


Deleting all the contents of a directory -
Hello.. Is there any shortcut way or whatever way of deleting all the contents of a directory? Thanks in advance


Search file(s) using wildcard -
Hi, can't really find anything about this so maybe someone can help me. I want to search a directory for eg: *.txt files and return the oldest .txt file from that directory but i have no idea how. Maybe someone can give me some more information how to accomplish that. Kind regard


ADO vs DAO wildcards -
Using DAO I can use the * character as a wildcard with the LIKE operator when quering an Access database. However, with ADO I can only achive the result by using % as a wildcard. Is this correct? John


Instr Wildcard -RESOLVED -
Hello guys, I'm trying to find out if theres any way to use a wildcard in the instr function. Or comparing any two strings in anyway really. Say for instance I wanted to parse a log file that would have a line in it like (this is totally made up out of my head btw hehe) Susan told


deleting un-empty directory -
i am using rmdir to delete directories but it does not seem to work when there is something in the directory any easy ways to fix this?


wildcard in where part of Select -
I am building a Select Statement based on some listbox selections. When * is selected in the listbox I want it to be a wildcard. When I build it like this it doesn't work: "Select a from TableA where b = " & Listbox1.Text It doesn't work when * is the selection no


Deleting a directory...[Help Needed] -
hi guys, please how do u delete a directory without getting the "Permission Denied" error. please note that the directory is CHMOD 777 but it still won't delete. Thank You


what's wrong with this wildcard character -
I'm using the wonderful AS400 DB2 for an SQL assignment (not by my choice!) and nobody in the class, the teacher included, can get the wildcard characters to work. If I remember correctly, it's a % for a * and an underscore for a single replacement character. I think I also have to u


variable character -
hey, i was wondering if there is a wildcard character in vb, or would i have to declair one. if i do have to declare a wildcard, how would i do that?


Wildcard parameter search -
How can I create a wildcard parameter search in querry Builder? Does anyne know. No code I have tried and found on the net doesn't work. I tried to write in to SQL statements like this: WHERE (LastName LIKE '%' & [Enter] & '%') When I create parameter search it is l


[2008] get an array of folder names in a directory -
Hi I am wondering how I can load the names of all folders in a set directory into an array in vb 2008, seems a simple enough job but I wouldn't know where to start or what to search on google to find out.


Wildcard search -
The db i have written needs to be able to search using wildcards e.g. *abc123 allowing suffix and prefix searches. What is the code?!?!?!? I have recordset.findfirst code but i can't wildcard. Somebody pleez help.


wildcard querry -
Hi I am very new at programing in VB, so please don't laugh... I am writting a program with imported Access database file. I want to perform a querry. I have VB 5 express edition. I create a querry with clicking on MyDatabaseTableAdapter then Add Querry... Then table adapter con


2008 wildcard sql -
I am trying to build an address book and would like to know how to code a wild card entry. Instead of using a combobox with a list of categories to use in the database, how can the user enter their own category using sql. Thanks prme


Help with regex expressions -
I have this "usual" windows wildcard: "*ftp*ftp* 0 *-*-*-*" Can anybody tell me what is the equivalent of this "windows wildcard" to a regular expression so I can use it with Regex.IsMath()? Or is there any other string function that will accept a &quo


DeleteFile API Call -
Is it possible to use Wildcard characters (*) with this API call, cos it don't seem to be lettin me do it. If not, is there another simple way to delete all the files in a given directory without prompting for confirmation? Cheers Paul


Wildcard with Oracle -
Hey guys. I am attempting to use a wildcard in an Oracle SQL statement. I want to return all names that END in "S". HOwever, when I use the wildcard it returns all names that have an "S" in them anywhere. Here is my query... SELECT * FROM Emp WHERE EmpName LI


Can I write to a directory -
Hi group, I want to check if the current logged in user has WRITE privileges to a certain directory. How can I check that WITHOUT writing a file to that directory and after that deleting that file again. So i want to check if a user can or cannot write to a certain directory!


copying and deleting .tifs and docs from one directory to another -
I need to copy tifs from one directory to another. Does anyone know how to do this?


How to find out if a sub directory is empty -
I want to delete a sub directory only if it is empty. Does anyone know how I can determine this and the best way to go about deleting it? Thanks


Deleting all files in a folder -
Hi Guys, I want to delete the contents of a directory and i don't really know how to go about doing that. The directory may or may not contain files and it will contain an unknown number of files. Any help would be greatly appreciated.


Wildcard Searching in Word -
I am trying to write a simple macro to highlight all the xml tagging of a document in Word, but Word wont seem to let me use the characters '<' and '>' in a wildcard search because they're reserved for the beginning and the end of a word. Does anyone know a way around this, or i


Use wildcard characters, such as * with Between operator -
How Can i use wildcard characters, such as * with Between operator in a querie on the a criteria row? Ex Between 200101* And 200109*. When I write like this it doesen't work. How do I do?


CR 11 Wildcard -> Param -
Is there a wildcard character I can use in a parameter to pull all the data instead of using an actually parameter? I would like to give the user an option to use specific criteria or pull all the data on one report. Thanks!


how to delete a specific file in a directory -
hi everyone! just want to ask if how can i delete s specific file in a directory. i've tried using system.io.directory.delete(path,true), but this will delete all the files located on that directory. is there any code similar to getting a files (eg. system.io.directory.getfiles(path


2 small problems -
Greetings. I have 2 small problems that I hope someone can help me with please: 1st problem: How do I show a pdf file from within VB? I have a menu item called "manual" and when the user selects it, i want to load Acrobat Reader (if they've got it of course) and laun


2 small problems (ooer!) -
Greetings. I have 2 small problems that I hope someone can help me with please: 1st problem: How do I show a pdf file from within VB? I have a menu item called "manual" and when the user selects it, i want to load Acrobat Reader (if they've got it of course) and launch


Bmp2Jpeg.dll... -
Hello, For those of u familiar with the Bmp2Jpeg.dll, i have 2 problems that u may be able to assist me with: - How can i save a picture loaded in a picture box directly into jpg?? I mean as far as i know, the dll only converts a bmp file into jpg, so is there a different way the


wildcard exist -
hey guys, this is a simple question but i dont know the answer to it and it is really holding me up. how could i find whether a type of file exists within a folder? so basically i want to know how i could check the folder for the existence of a file type using a wildcard. i tri