I was able to get the network drive mounted programmatically, but not in a way that I thought was going to work, hopefully the following may help or point someone else in the proper direction and if someone has any suggestions (someone a lot smarter than me in the Linux world) I will be appreciative.
I tried Erel's suggestions to use the Run without the RunWithOutoutEvents, this did not work.
I then tried Erel's other suggestion, by removing the Sudo statement, and this did not work either.
How I solved the problem - at least, one way I guess. There are probably other ways to. There are a lot of smart people on this forum.
If I only used the command mount in the shell command, I was able to get an output in the log, of what was currently mounted. So at least I knew the mount command would run from the Jshell. I then tried to parse the command, by adding a string array of the extra statements, thinking the issue may be a parsing problem, but this was a dead end.
I then created a bash script, which I tested in terminal mode, and it worked fine. I was thinking of the parsing of such a long command line, that maybe the Jshell was not handling this properly and using a bash script would be successful. Unfortunately I got the same results.
I did not understand what was going on here, why Jshell was always telling I had a directory or file error??
I then realized that I was also using the Jshell command successfully for calling a touch screen calibration program. The difference here was the touch screen calibration program was not sitting in my home directory, but in the file system directory /user/local/egalaxytouch.
So I copied the bash script as administrator to /usr/local/bin directory (could have made up a new one, but it was there, so why not use it.).
Lo and behold, this worked. Success, maybe.
The mount of the network drive has to be user defined, and I did not know, if I created the bash script with user input, whether (1) it would save properly to a filesystem directory and (2) if it would then run. So I created a quick test program to generate a bash script, then save it to /usr/local/bin and the set the file to executable.
File.OpenOutput("/usr/local/bin","net1.sh",True)
File.WriteString("/usr/local/bin","net1.sh","#!/bin/sh")
File.WriteString("/usr/local/bin","net1.sh","sudo -S mount -t cifs -w -o username=service -o password=service //192.168.2.75/jobs /home/microcut/mnt/shared")
Private jf As FileWatcher
jf.SetExecutable("/usr/local/bin/net1.sh",True,2)
shl.Initialize("net","/usr/local/bin/net1.sh",Null)
shl.WorkingDirectory = "/usr/local/bin/"
shl.Run(1000)
This worked fine, so all I will need to do in the future is create a small input program for the user, to get the username, password, server/workstation IP address and directory.
And substitute those values.
So hopefully this may help someone else, and I am sure that even though this works, there are probably better ways to do this, if anyone knows, just post your thoughts.