B4J Question CMD.Exe

wle1036

New Member
i use
jShell library

and i want run Hep on cmd.exe


PHP:
Dim shl As Shell
    shl.Initialize("shl", "cmd.exe", Array As String("Help"))
    shl.WorkingDirectory = "C:\Windows\System32\"
--------------


output is :
Success
Microsoft Windows [Version 10.0.17134.112]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\Windows\System32>

Help not run .

plz hlp me
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Please use [code]code here...[/code] tags when posting code.

B4X:
Sub Test
   Dim shl As Shell
   shl.Initialize("shl", "cmd.exe", Array("/c", "Help"))
   shl.WorkingDirectory = "C:\Windows\System32\"
   shl.Run(-1)
   Wait For shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
   Log(StdOut)
   Log(Success)
End Sub
 
Upvote 0

LWGShane

Well-Known Member
Licensed User
Longtime User
Please use [code]code here...[/code] tags when posting code.

B4X:
Sub Test
   Dim shl As Shell
   shl.Initialize("shl", "cmd.exe", Array("/c", "Help"))
   shl.WorkingDirectory = "C:\Windows\System32\"
   shl.Run(-1)
   Wait For shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
   Log(StdOut)
   Log(Success)
End Sub

You can also use the full path for CMD ("C:\Windows\System32\cmd.exe") as the executable.
 
Upvote 0
Top