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:
Also, the Wiki says to use Shell "Cmd /C" or it may hang..
Thank you, Erik.
This is some code I have been using:
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$
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