473,396 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

BATCH SCRIPT: How to search for fixed length filenames?

DTeCH
23
Hello guys, as you can see, there was no place to ask this question on bytes because there's no batch section.

Anyway, here goes.

I am having a hard time figuring out how to return only fixed length filenames that has been specified... like ????.exe, & would also like to know if there's a way to specify what not to include in the names, like _ . or any non-alphanumeric character.


I have tried the following, but I just don't know how to deal with forcing the return of FIXED length filenames only.

Expand|Select|Wrap|Line Numbers
  1. @echo off
  2.  
  3. echo.
  4. echo ####################################################################
  5. echo File Deleter v1.0 - 2012 by: DTeCH
  6. echo ####################################################################
  7. echo.
  8. if exist %APPDATA%\????.exe goto Detected  <-----( Here )
  9. if not exist %APPDATA%\????.exe goto NotDetected <-----( Here )
  10.  
  11. :Detected
  12. echo Files Detected. Deleting...
  13. cd %APPDATA%
  14. del ????.dll /s <-----( Here )
  15. echo.
  16. echo Done :)
  17. echo.
  18. goto LetsContinue
  19.  
  20. :NotDetected
  21. echo Files NOT Detected... Hooray!
  22. echo :D
  23. echo.
  24.  
  25. :LetsContinue
  26. echo ####################################################################
  27. echo.
  28. TIMEOUT /T 15 /NOBREAK
  29.  

The Wild Card character * allows any length of characters to match, & returns unwanted files. I need to return only specific length file names.

*.exe does not work for this. Is there any other characters I can use to specify a fixed length of chars, or some other method?


Can someone shine a light here for me please? :)

Thanks.
Oct 13 '12 #1
2 2603
Rabbit
12,516 Expert Mod 8TB
This has been moved to the windows forum because when you say batch, I assume you're talking about a windows batch script.
Oct 14 '12 #2
DTeCH
23
yes, sorry :)

It is a windows Batch script. Thanks Rabbit
Oct 14 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

26
by: Adrian Parker | last post by:
I'm using the code below in my project. When I print all of these fixed length string variables, one per line, they strings in questions do not properly pad with 0s. strQuantity prints as " ...
3
by: ecov | last post by:
Is there any easy way to read into a dataset a file that was created from a BCP command. The file is in a fixed length format. I would also like to be able to write out a dataset to the same type...
5
by: David Garamond | last post by:
The MySQL manual recommends that we create a "fixed-length row" if possible, for speed (especially scanning speed). A fixed-length row is a row which is comprised of only fixed-length fields. A...
0
by: py | last post by:
I am trying to execute a batch script on a remote computer. The batch script looks like: @echo off start c:\python24\python.exe c:\a_script.py Here's the setup: Computer A (my computer),...
1
by: Rick Knospler | last post by:
I am trying to convert a vb6 project to vb.net. The conversion worked for the most part except for the fixed length strings and fixed length string arrays. Bascially the vb6 programmer stored all...
1
by: kendrick82 | last post by:
Hi, I would like to seek some advise and assistance regarding the following matter as I am new to VB.Net. I'll appreciate any helps render. I am developing a VB application using VB.Net 2003 to...
5
by: veeraiah | last post by:
Hi, I am new to PERL Scripting, i need your help with one of the problem i am having. I am having a PERL Script which has two variables $CurMon and $PriorMon. a Windows batch script calls this...
3
by: darren | last post by:
Hi I have an assignment that is in C and, for an API call, asks for a uint_16 and uint_32 in one of its functions. In my C++ code i've been using uint16_t and uint32_t for fixed length...
6
by: ssharpjr | last post by:
Hi Guys, I'm new to Python (mostly) and I'm wanting to use it for a new project I'm faced with. I have a machine (PLC) that is dumping its test results into a fixed- length text file. I need...
2
by: Edwin.Madari | last post by:
#your thought is right. ======================================================= def sizes2fields(sizes): d = begin = 0 for i in sizes: if begin: end = begin + i else: end = i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.