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
Random errors in TensorFl...
by
jollytall
[
Today
at 10:14:30 pm]
Online tutor using remote...
by
silvercoder70
[
Today
at 10:04:11 pm]
how to control the order ...
by
mas steindorff
[
Today
at 08:47:04 pm]
Wiki, a dead link in page...
by
d7_2_laz
[
Today
at 08:42:35 pm]
DBLookupListBox shows (ME...
by
heebiejeebies
[
Today
at 08:12:05 pm]
How to save a Graphic fro...
by
jeremiah
[
Today
at 08:11:54 pm]
Interesting article about...
by
Curt Carpenter
[
Today
at 08:05:02 pm]
Crosshair error when chan...
by
Marq01
[
Today
at 08:02:17 pm]
Adding interfaces to any ...
by
Thaddy
[
Today
at 07:32:56 pm]
AVRPascal – free code edi...
by
ackarwow
[
Today
at 04:57:47 pm]
MainMenu: How to use the ...
by
madref
[
Today
at 04:19:32 pm]
SAVE StringGrid to PDF
by
dseligo
[
Today
at 04:13:22 pm]
I need advice for a new c...
by
wp
[
Today
at 03:18:11 pm]
Controlled Folder Access
by
Igor Kokarev
[
Today
at 02:17:46 pm]
Datatypes Interoperabilit...
by
silvercoder70
[
Today
at 01:32:48 pm]
Notepad++ plugin with doc...
by
d7_2_laz
[
Today
at 01:11:52 pm]
ZDataset.Locate + loParti...
by
silvercoder70
[
Today
at 10:49:08 am]
SQLite3 Date Problem
by
silvercoder70
[
Today
at 10:08:07 am]
Record "inheritance"/stru...
by
Thaddy
[
Today
at 09:54:38 am]
D2Bridge Framework for La...
by
egsuh
[
Today
at 04:48:02 am]
Application deployment
by
cousinp
[
Today
at 04:28:36 am]
[SOLVED] FPSpreadSheet, ...
by
TRon
[
Today
at 01:25:51 am]
Is it possible to do git ...
by
TRon
[
Today
at 12:41:39 am]
had a question and found ...
by
TRon
[
Today
at 12:36:57 am]
Draw Transparent Fill Rec...
by
LBox
[
Today
at 12:00:51 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Status Drives Search (Read 985 times)
d2010
Jr. Member
Posts: 65
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: 5469
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: 65
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