B4J Question Shell program.

cstangor

Member
Licensed User
Longtime User
Hello,

I'm having trouble with the shell command:

B4X:
Dim shl As Shell
  Log (File.Exists("C:\users\n\skydrive\", "wordpad.exe"))
  shl.Initialize("shl", "wordpad.exe", Null) 
  shl.WorkingDirectory = "C:\users\n\skydrive\"
  shl.Run(10000) 'set a timeout of 10 seconds

produces:
Error: org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "wordpad.exe" (in directory "C:\users\n\skydrive"): CreateProcess error=2, The system cannot find the file specified)

This seems to happen no matter what file is called for, although the files do exist (see line 2 of code which produces true).

Thanks in advance
 

stevel05

Expert
Licensed User
Longtime User
Have you tried:

B4X:
Dim shl As Shell
  Log (File.Exists("C:\users\n\skydrive\", "wordpad.exe"))
  shl.Initialize("shl", "C:\users\n\skydrive\wordpad.exe", Null)
  shl.WorkingDirectory = "C:\users\n\skydrive\"
  shl.Run(10000) 'set a timeout of 10 seconds
 
Upvote 0

cstangor

Member
Licensed User
Longtime User
Have you tried:

B4X:
Dim shl As Shell
  Log (File.Exists("C:\users\n\skydrive\", "wordpad.exe"))
  shl.Initialize("shl", "C:\users\n\skydrive\wordpad.exe", Null)
  shl.WorkingDirectory = "C:\users\n\skydrive\"
  shl.Run(10000) 'set a timeout of 10 seconds

Thanks Steve! - you are awesome!
 
Upvote 0
Top