Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shell issues
#1
Hi,

When using Shell with no parameters the program displays a blank screen which cannot be exited
without going to Task Manager->Processes and manually right-click and end task!?

Instead I am using Shell "Cmd" to properly starting a dos-like window shell and prompt to exit.

Why is this? And does Linux/MacOsX require other than "Cmd" to load shell?

Should I otherwise use the following:

Code: (Select All)
Comspec$=Environ$("COMSPEC")
Shell Comspec$
Also, the Wiki says to use Shell "Cmd /C" or it may hang..

Thank you, Erik.

This is some code I have been using:

Code: (Select All)
' program to shell to window
Print "Enter shell command:";
Line Input x$
Call ShellSub(x$)
End

' subroutine to shell to dos
Sub ShellSub (x$)
   If x$ = "" Then
      Comspec$ = Environ$("COMSPEC")
      If Len(Comspec$) Then
         Shell Comspec$
      Else
         Shell "CMD"
      End If
   Else
      X = FreeFile
      Open "SHELL.BAT" For Output As #X
      Print #X, "@ECHO OFF"
      Print #X, x$
      Print #X, "PAUSE"
      Print #X, "EXIT"
      Close #X
      Shell "SHELL.BAT"
   End If
End Sub
Reply


Messages In This Thread
Shell issues - by eoredson - 05-05-2025, 03:03 AM
RE: Shell issues - by SMcNeill - 05-05-2025, 04:43 AM
RE: Shell issues - by eoredson - 05-07-2025, 12:26 AM
RE: Shell issues - by ahenry3068 - 05-07-2025, 03:56 AM
RE: Shell issues - by SMcNeill - 05-07-2025, 04:34 AM
RE: Shell issues - by eoredson - 05-07-2025, 04:39 AM
RE: Shell issues - by hsiangch_ong - 05-07-2025, 08:26 AM
RE: Shell issues - by eoredson - 05-10-2025, 02:59 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  code locks up when SHELL paulel 4 261 02-15-2026, 08:04 PM
Last Post: madscijr
  Help: Issues with the _PRINTSTRING and _INPUTBOX$ functions in QB64. qbfans 2 350 02-13-2026, 06:07 AM
Last Post: qbfans
  Breaking out of a Shell PhilOfPerth 3 535 07-02-2025, 02:59 AM
Last Post: PhilOfPerth
  Command$ issues eoredson 8 1,351 05-02-2025, 01:42 AM
Last Post: eoredson
  Multiple Text Box Issues for a Beginner Vespin 11 1,594 10-30-2024, 05:32 PM
Last Post: Vespin

Forum Jump:


Users browsing this thread: 1 Guest(s)