Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
accessing the CLI in a prog
#6
Code: (Select All)
$Console:Only
Shell "dir c:\ > temp.txt" '      <-- this runs that shell command to DIR to get a listing of C:\, and then pipes the output to "temp.txt".
Open "temp.txt" For Input As #1
Do Until EOF(1)
    Line Input #1, text$
    Print text$
Loop

Give the above a try.  The issue with the blank screen was you specifying  "c: dir" and me just plugging it in by mistake.  There's no "dir.com", "dir.exe", or "dir.bat" file in the "c:\" directory, so no file to run and thus nothing to pipe.  Big Grin

By *just* using the DIR command, the system looks in the various paths and finds where that command is located, and then gives you a directory listing of C:\, as specified above.

Anytime you have issues with SHELL, test your command with $CONSOLE:ONLY.  Then your QB64 program will run in the console/terminal and you'll see the output before that shell window opens and closes instantly on you.  It's a great way to get those error messages and determine what the heck has gone wrong.
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)