0

I have a remote machine (let's call it Target) on which the driver OpenEdge 10.1B is installed (communication with Progress database).

I have an exe on this remote machine that connects to the Progress database through the driver. When i log onto this machine (rdp) with my windows account then I test this executable file, i can see that it connects to the database successfully.

What i need to do is execute this exe remotely, from a machine, call it Source. For this, I use PsTools. Note that I execute this code logged with my windows account (on the same domain than the machine Target) Below is the c# code I use to execute this file.

public static bool Execute(List<string> tablesNames)
        {            
            //the process to start
            const string processName = @"C:\script\MyProgram.exe";
            var serverName = "theServerName";
            //params for MyProgram.exe
            var param = "-s " + String.Join(" ", tablesNames);

            try
            {//example: c:\pstools\psexec.exe \\theServerName C:\script\MyProgram.exe -s tableName1 tableName2
                //Start the process
                ProcessStartInfo info = new ProcessStartInfo("C:\\PsTools");
                info.LoadUserProfile = true;
                info.FileName = @"C:\PsTools\psexec.exe";
                info.Arguments = $@"\\{serverName} {processName} " + param;
                info.RedirectStandardOutput = true;
                info.UseShellExecute = false;
                Process p = Process.Start(info);

                Console.WriteLine( "Program " + processName + " was started correctly.");
                return true;
            }
            catch (Exception ex)
            {
                Console.WriteLine( ex.ToString());
                return false;
            }
        }

The error I get on the log of the machine Target is:

ERROR [IM003] Specified driver could not be loaded due to system error 5: Access is denied. (OpenEdge 10.1B driver, [...]

Notes:

  • the datasource is a 32-bit system DSN on machine Target.
  • Both Source and Target machines are 64-bit.

As I previously said, executing MyProgram.exe works well when i run it directly from machine Target.

Any ideas on what I may have done wrong ?

4
  • I'd start by creating a batch echoing the PATH to a file, I'm thinking path is set wrong when psexec is running it.
    – bupereira
    Mar 7, 2018 at 15:38
  • thanks @bupereira i tried to call a batch file instead, and it is called without any problem : the syntax seems to work here.
    – ryder80
    Mar 7, 2018 at 18:10
  • I just edited the question, as in my original post, there was a copy/paste mistake : the error i really get is about denied access from the openedge driver.
    – ryder80
    Mar 7, 2018 at 18:11
  • According to these links, it seems to be a folder permission problem. They're not OpenEdge related, but the error seems to be common in remote connection environments. Check this out, even if just to rule out this issue: forums.asp.net/t/1614927.aspx?Head+Banging+ODBC+Problem And this one support.plesk.com/hc/en-us/articles/…
    – bupereira
    Mar 8, 2018 at 20:29

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.