Command Line from Windows 2003 Server

bradscheepersbradscheepers Posts: 10
edited July 7, 2006 2:35PM in SQL Compare Previous Versions
Hi there

I'm using the command line interface in SQL Compare 5 Professional.

On my PC (Windows XP Pro) and on a Windows 2000 Server I can run a .bat file that sits on my machine to run sqlcompare.exe and it works perfectly.

But when I run this from a Windows 2003 Server I get an error that fills the command prompt window with XML-like tags and alot of "System.Security.Permissions.SecurityPermission" type data.

The following error then appears in a dialog box:

SQLCompare.exe - Common Laguage Runtime Debugging Services
Application has generated an exception that could not be handled.
Process id=0x240c (9228), Thread id=0x25a4 (9636)

Does this mean anything to you?

I have also tried just running the SqlCompare.exe over the network by itself and I get the same error. I have tried playing with all the security settings and permissions I can think of. Any other .exe works just fine on all platforms (I tried running calc.exe - Windows calculator).

Any ideas?

Thanks alot


  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hello Brad,

    I think the issue is with .NET. As far as I know, the Framework will not let you execute assemblies from a remote network share. I've tried to get around this using the framework wizards, elevating the trust level, etc, but haven't found a way to do it.

    You'll more than likely need to copy all of the necessary comand-line support files to the local machine and run it from there.
  • Options
    Hi Brian

    I'm not sure that will help as the SQL Compare Pro is installed on one machine and there are a handfull of Windows 2003 Servers running SQL Server that will call this .exe over the network.

    What is it exactly that you are suggesting I copy?

  • Options
    THE ANSWER ....

    Hi Brian

    I got the answer. .NET doesn't like running .exe's over the network because of trust issues, so to solve this do the following:

    On the server you want to call the remote .exe from ....
    Go to Start > Programs > Admin Tools > .NET Configuration ...
    then to Runtime Security Policy > Machine > Code Groups > All Code ...

    > Then create a new group.
    > Make the condition type "URL"
    > Make the URL [url=file://machine_hosting_exe_name/*]file://machine_hosting_exe_name/*[/url]
    > Set the permissions to "Full Trust"

    And there you go - everything run from the hosting machine will be allowed. You can obviously narrow it down to only allow your exe etc.

  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi Brad,

    It looks like you beat me to it! Thanks for passing on the solution.
This discussion has been closed.