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 - 3 hours ago



Users browsing this thread: 2 Guest(s)