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
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
[SOLVED] The main screen ...
by
Hansvb
[
Today
at 06:50:52 pm]
Transparent Form: Some Th...
by
LV
[
Today
at 05:53:43 pm]
[SOLVED] Don't find the U...
by
Hartmut
[
Today
at 05:23:36 pm]
Debian removes FPC/Lazaru...
by
dsiders
[
Today
at 05:07:33 pm]
[Closed]FPC error when us...
by
marcov
[
Today
at 04:19:50 pm]
LCL Web Native with D2Bri...
by
mdalacu
[
Today
at 04:18:53 pm]
Sidmon Player Library
by
Gigatron
[
Today
at 02:56:58 pm]
Lazaris IDE v4.4 - extrem...
by
backprop
[
Today
at 02:16:58 pm]
Who is absent from year 2...
by
backprop
[
Today
at 01:52:41 pm]
[RESOLVED] Log in to web ...
by
rvk
[
Today
at 01:26:35 pm]
Status of FPC 3.4.0 or FP...
by
marcov
[
Today
at 12:54:39 pm]
Help with diabetes projec...
by
slicke
[
Today
at 12:13:28 pm]
it2play - IT/S3M module r...
by
Lulu
[
Today
at 10:00:59 am]
FPC and Lazarus coding st...
by
Martin_fr
[
Today
at 09:21:46 am]
Free Pascal for a small e...
by
cdbc
[
Today
at 07:06:42 am]
FPCUnit returns 2 error l...
by
n7800
[
Today
at 02:43:55 am]
Defaults for features
by
Martin_fr
[
Today
at 02:07:48 am]
TLazSerial : serial port ...
by
CM630
[February 06, 2026, 11:02:03 pm]
function intersect in laz...
by
wp
[February 06, 2026, 08:30:39 pm]
Notetask 1.1.0 - Free cro...
by
AlexanderT
[February 06, 2026, 02:33:56 pm]
Rolling releases Lazarus[...
by
marcov
[February 06, 2026, 02:07:36 pm]
lazarus IDE anchordock ba...
by
szlbz
[February 06, 2026, 12:53:12 pm]
Upload multipart POST req...
by
OH1KH
[February 06, 2026, 11:53:17 am]
Ininside ProjectSession, ...
by
d2010
[February 06, 2026, 10:34:50 am]
Recommendations for wasm3...
by
temp0
[February 06, 2026, 03:47:38 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Status Drives Search (Read 1362 times)
d2010
Sr. Member
Posts: 251
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: 5674
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
Sr. Member
Posts: 251
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