06-16-2025, 04:19 AM
Solves specifying Shell w/o parameter:
Code: (Select All)
Print "Enter DOS command";
Input Var$
Call ShellProgram(Var$)
End
' SHELL Param$
Sub ShellProgram (Var$)
If Len(Var$) Then
FX$ = "SHELL.BAT"
X = FreeFile
Open FX$ For Output As #X
Print #X, "@ECHO OFF"
Print #X, Var$
Print #X, "PAUSE"
Print #X, "EXIT"
Close #X
Shell FX$
Print "Returned from DOS shell."
Exit Sub
End If
Print "Type 'EXIT' to return."
Comspec$ = Environ$("COMSPEC")
If Len(Comspec$) Then
Shell Comspec$
Else
Shell "CMD"
End If
Print "Returned from DOS shell."
End Sub
