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
StringGrid colored rows d...
by
wp
[December 02, 2024, 11:21:00 pm]
Amigo programming languag...
by
maurog
[December 02, 2024, 11:19:44 pm]
[SOLVED] How to document ...
by
korba812
[December 02, 2024, 10:49:39 pm]
AVRPascal – free code edi...
by
ackarwow
[December 02, 2024, 10:18:22 pm]
storing string
by
Remy Lebeau
[December 02, 2024, 09:46:56 pm]
How do you know wich vers...
by
Warfley
[December 02, 2024, 08:32:11 pm]
Unable to find file "date...
by
Cumberland
[December 02, 2024, 08:27:29 pm]
Common File Dialogs Have ...
by
rvk
[December 02, 2024, 07:33:14 pm]
Developing a Kernel Modul...
by
nicolap
[December 02, 2024, 05:37:05 pm]
LazMapView - adding a sca...
by
alpine
[December 02, 2024, 05:26:28 pm]
[SOLVED] Howto use a DEFI...
by
tintinux
[December 02, 2024, 04:55:13 pm]
ZDataset.Locate + loParti...
by
tintinux
[December 02, 2024, 04:47:48 pm]
Strange memory allocation...
by
MathMan
[December 02, 2024, 03:40:40 pm]
Best UI to adopte while d...
by
marcov
[December 02, 2024, 02:42:45 pm]
Random SnowFlakes:
by
Boleeman
[December 02, 2024, 12:24:18 pm]
AY_FLY Library
by
Thaddy
[December 02, 2024, 11:50:21 am]
Hustle - A simple task ma...
by
MarkMLl
[December 02, 2024, 11:37:20 am]
How much would it hamper ...
by
Thaddy
[December 02, 2024, 11:36:24 am]
Lazarus MDI application.
by
Fred vS
[December 02, 2024, 11:25:21 am]
Linking question
by
Khrys
[December 02, 2024, 10:23:13 am]
CudaText Editor (written ...
by
AlexTP
[December 02, 2024, 10:16:27 am]
sql log file with sql sta...
by
Zvoni
[December 02, 2024, 09:06:27 am]
NSHapticFeedbackPerformer
by
msintle
[December 02, 2024, 01:29:22 am]
Error: (1026) Compilation...
by
daniel_sap
[December 01, 2024, 08:02:58 pm]
Worksheet.PageLayout
by
seghele0
[December 01, 2024, 04:30:15 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Status Drives Search (Read 958 times)
d2010
Jr. Member
Posts: 61
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: 5465
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: 61
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