Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Program Solution#2
#1
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Program Solution#5 eoredson 5 540 10-21-2025, 07:59 AM
Last Post: bplus
  Program Solution#4 eoredson 0 459 06-18-2025, 03:32 AM
Last Post: eoredson
  Program Solution#3 eoredson 1 485 06-17-2025, 04:16 AM
Last Post: SierraKen
  Program Solution#1 eoredson 0 413 06-16-2025, 04:17 AM
Last Post: eoredson

Forum Jump:


Users browsing this thread: 1 Guest(s)