Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
accessing the CLI in a prog
#18
(02-01-2024, 04:28 PM)Steffan-68 Wrote:
(02-01-2024, 06:17 AM)PhilOfPerth Wrote: Using some of the bits and pieces I've learned from this forum, I built the small prog below.
Not earth-shattering, but I'm quite proud of it. It lets me see the contents of any of my drives.
Code: (Select All)
Screen _NewImage(1200, 820, 32)
SetFont: f& = _LoadFont("C:\WINDOWS\fonts\courbd.ttf", 24, "monospace"): _Font f&
fontsize = 24
_ScreenMove (_DesktopWidth - _Width) / 2, 86 ' centre display on screen
botline = _Height / _FontHeight - 2
Print "Drive letter (a to z)?"
Print "Esc to finish"
GetDrive: dl$ = UCase$(InKey$)
If dl$ = Chr$(27) Then System
If dl$ < "A" Or dl$ > "Z" Then GoTo GetDrive
comd$ = "dir " + dl$ + ":\ " + " > temp.txt"
Print comd$
Shell comd$
Open "temp.txt" For Input As #1
Do Until EOF(1)
    Line Input #1, text$
    Print text$
    If CsrLin > botline Then Print "More...": Sleep: Cls
Loop
Print "Press a key":: Sleep: Cls: Run
And if you change the last line E.g

Print "Press a key": Sleep: Cls: Close #1: Kill ".\temp.txt": Run

Would you delete the TEMP file at the end .

Yes, thanks Stefan. Two of my  many crimes are forgetting to close files, and to remove them.
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, W.A.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply


Messages In This Thread
accessing the CLI in a prog - by PhilOfPerth - 01-31-2024, 01:31 AM
RE: accessing the CLI in a prog - by SMcNeill - 01-31-2024, 01:45 AM
RE: accessing the CLI in a prog - by bplus - 01-31-2024, 01:48 AM
RE: accessing the CLI in a prog - by TerryRitchie - 01-31-2024, 02:02 AM
RE: accessing the CLI in a prog - by PhilOfPerth - 01-31-2024, 10:50 AM
RE: accessing the CLI in a prog - by SMcNeill - 01-31-2024, 11:48 AM
RE: accessing the CLI in a prog - by PhilOfPerth - 01-31-2024, 11:08 PM
RE: accessing the CLI in a prog - by GareBear - 01-31-2024, 04:08 PM
RE: accessing the CLI in a prog - by bplus - 01-31-2024, 06:05 PM
RE: accessing the CLI in a prog - by GareBear - 01-31-2024, 07:28 PM
RE: accessing the CLI in a prog - by SMcNeill - 01-31-2024, 09:57 PM
RE: accessing the CLI in a prog - by GareBear - 02-01-2024, 01:24 AM
RE: accessing the CLI in a prog - by SMcNeill - 02-01-2024, 01:31 AM
RE: accessing the CLI in a prog - by DSMan195276 - 02-01-2024, 01:59 AM
RE: accessing the CLI in a prog - by GareBear - 02-01-2024, 03:32 AM
RE: accessing the CLI in a prog - by PhilOfPerth - 02-01-2024, 06:17 AM
RE: accessing the CLI in a prog - by Steffan-68 - 02-01-2024, 04:28 PM
RE: accessing the CLI in a prog - by PhilOfPerth - 02-01-2024, 11:19 PM



Users browsing this thread: 1 Guest(s)