B4J Question Help: running 'Openfiles' command on Windows server 2003 x64 (SOLVED)

jmon

Well-Known Member
Licensed User
Longtime User
Hello,

When I run this on Windows Server 2003 R2 x64:
B4X:
Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.RootPane.LoadLayout("Main") 'Load the layout file.
    MainForm.Show
   
    Dim shl As Shell
    shl.Initialize("getOpenFiles", "cmd.exe", Array As String("/c", "openfiles"))
'    shl.WorkingDirectory = "c:\windows\System32"
    shl.Run(-1)
End Sub

Sub getOpenFiles_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
    Log(StdOut)
    Log(StdErr)
End Sub

I get this error:
Program started.
'openfiles' is not recognized as an internal or external command,
operable program or batch file.

Though when I run "openfiles" in "cmd", it works. Also, the exact same command, but just replacing "openfiles" with "ipconfig" runs properly and returns some information.

Could it be that B4J doesn't have the rights to execute the command? Or another guess, is that I have the java JDK x86 installed.
 
Top