Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Operating Systems
»
Windows
»
Status Drives Search
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
SDL2: Runtime Error 216 o...
by
mischi
[
Today
at 10:25:05 am]
Vulnerabilities lurking i...
by
colo
[
Today
at 09:45:08 am]
TSQLquery does not save a...
by
Zvoni
[
Today
at 09:14:58 am]
[SOLEVD] Unwanted additio...
by
CM630
[
Today
at 08:32:42 am]
ЛазМер/ LazMer for measur...
by
CM630
[
Today
at 08:22:23 am]
Compile auxilliary units ...
by
Wesbat
[
Today
at 08:17:22 am]
How to combine data from ...
by
Zvoni
[
Today
at 08:13:09 am]
Nested declarations insid...
by
440bx
[
Today
at 06:02:53 am]
Lazarus Pascal Keywords a...
by
dbannon
[
Today
at 05:34:52 am]
New old guy
by
TBMan
[
Today
at 04:00:47 am]
How to validate ParamStr(...
by
n7800
[
Today
at 03:29:56 am]
Why with allows assignmen...
by
440bx
[
Today
at 03:02:26 am]
Lazarus Release Candidate...
by
calebs
[
Today
at 01:55:45 am]
MQTT Client
by
cdbc
[January 12, 2025, 10:48:04 pm]
SDL2 image rotation Probl...
by
Fred vS
[January 12, 2025, 09:30:11 pm]
FPC crashes after running...
by
jamie
[January 12, 2025, 09:20:00 pm]
Out of memory / filter tw...
by
BubikolRamios
[January 12, 2025, 08:32:02 pm]
rebuilding IDE fails
by
Martin_fr
[January 12, 2025, 08:24:54 pm]
How do I access data memo...
by
TBMan
[January 12, 2025, 08:10:18 pm]
Out of heap
by
BubikolRamios
[January 12, 2025, 07:53:17 pm]
Where do I get IdHTTP, ...
by
Thaddy
[January 12, 2025, 07:03:36 pm]
TSQLQuery with lookup fie...
by
dpap
[January 12, 2025, 06:56:57 pm]
[Solved]Help needed with ...
by
cdbc
[January 12, 2025, 06:01:02 pm]
Large or huge sets
by
Thaddy
[January 12, 2025, 05:22:06 pm]
Pascal and Musical Tones ...
by
Roland57
[January 12, 2025, 04:11:37 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Status Drives Search (Read 1036 times)
d2010
Jr. Member
Posts: 73
Status Drives Search
«
on:
December 05, 2023, 08:43:15 am »
Hello.
I have in batch(".txt") script to reveal -all-drives.()
How to replace this batch(".txt") with pascal100%source?
--but only writeble disk/s drive
--but not CD-rom, not DVD
«
Last Edit: January 01, 2024, 10:54:41 am by d2010
»
Logged
Bart
Hero Member
Posts: 5494
Re: Windows. Status Drives Search
«
Reply #1 on:
December 05, 2023, 09:50:54 am »
I have a function like this:
Code: Pascal
[Select]
[+]
[-]
function
GetAvailableDrives
(
DiskMustBeInDrive
:
Boolean
=
False
;
DriveTypes
:
TDriveTypes
=
AllDriveTypes
)
:
TSysCharSet
;
As you can guess from it's signature you can search for writable drives that must be mounted.
You can find the code
here
.
Feel free to use and alter the code if so desired.
Bart
Logged
d2010
Jr. Member
Posts: 73
Re: Windows. Status Drives Search
«
Reply #2 on:
January 01, 2024, 10:54:22 am »
Thank you your-code, please you read my hints.
01)you replace upcase with locase
Code: Pascal
[Select]
[+]
[-]
D
:
=
GetLogicalDrives
;
for
C
:
=
'a'
to
'z'
do
begin
Mask
:
=
(
1
shl
(
Ord
(
c
)
-
Ord
(
'a'
)
)
)
;
if
(
Mask
and
D
)
=
Mask
then
begin
if
(
(
not
DiskMustBeInDrive
)
or
DiskInDrive
(
C
)
)
and
(
GetDriveType
(
C
)
in
DriveTypes
)
then
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Operating Systems
»
Windows
»
Status Drives Search
TinyPortal
© 2005-2018