<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using ShellExecute to open .mxd - Win 7 in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/using-shellexecute-to-open-mxd-win-7/m-p/283708#M7308</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;wow, shell... old school&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;windows 7 structures program files differently as well as user folders... (x86 for starters)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;so USERNAME is going to be a different path...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As richard states, should work, try throwing the MXD is a simple folder path to test.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Apr 2011 02:18:20 GMT</pubDate>
    <dc:creator>MichaelRobb</dc:creator>
    <dc:date>2011-04-01T02:18:20Z</dc:date>
    <item>
      <title>Using ShellExecute to open .mxd - Win 7</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/using-shellexecute-to-open-mxd-win-7/m-p/283702#M7302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a Delphi application that calls ShellExecute on a .mxd file.&amp;nbsp; It works fine in XP, but when trying to run on Win 7, ArcMap throws the error "Could not find file C:\users\username\My Documents\filename.mxd.mxd".&amp;nbsp; I'm not passing the filename with 2 .mxd's at the end.&amp;nbsp; Anyone have any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 19:24:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/using-shellexecute-to-open-mxd-win-7/m-p/283702#M7302</guid>
      <dc:creator>DavidKroll</dc:creator>
      <dc:date>2011-03-30T19:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using ShellExecute to open .mxd - Win 7</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/using-shellexecute-to-open-mxd-win-7/m-p/283703#M7303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Since your file name has spaces in it, did you put quotes around it?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 19:35:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/using-shellexecute-to-open-mxd-win-7/m-p/283703#M7303</guid>
      <dc:creator>RichardWatson</dc:creator>
      <dc:date>2011-03-30T19:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using ShellExecute to open .mxd - Win 7</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/using-shellexecute-to-open-mxd-win-7/m-p/283704#M7304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using a variable in the ShellExecute, so there's not an actual filename.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ShellExecute(Handle, 'open', PChar(FileNameVariable), nil, nil, SW_SHOWNORMAL) ;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2011 13:23:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/using-shellexecute-to-open-mxd-win-7/m-p/283704#M7304</guid>
      <dc:creator>DavidKroll</dc:creator>
      <dc:date>2011-03-31T13:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using ShellExecute to open .mxd - Win 7</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/using-shellexecute-to-open-mxd-win-7/m-p/283705#M7305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So the obvious question is what is the contents of FileNameVariable?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you literally type that into the Windows Start menu Run command does it work?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try a file path which does not have spaces in it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2011 13:40:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/using-shellexecute-to-open-mxd-win-7/m-p/283705#M7305</guid>
      <dc:creator>RichardWatson</dc:creator>
      <dc:date>2011-03-31T13:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using ShellExecute to open .mxd - Win 7</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/using-shellexecute-to-open-mxd-win-7/m-p/283706#M7306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Typing it in at the command prompt didn't work, so I moved the file to a path with no spaces and it works.&amp;nbsp; Just amazes me how this works in XP but not 7.&amp;nbsp; Oh well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2011 15:00:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/using-shellexecute-to-open-mxd-win-7/m-p/283706#M7306</guid>
      <dc:creator>DavidKroll</dc:creator>
      <dc:date>2011-03-31T15:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using ShellExecute to open .mxd - Win 7</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/using-shellexecute-to-open-mxd-win-7/m-p/283707#M7307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It should work from ShellExecute as well.&amp;nbsp; If the filename has spaces in it then you need to protect it by enclosing it in quotes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In C#:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string fileName = @"""c:\file path\file name with spaces.mxd""";&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It has been too long since I have written Pascal:(&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2011 15:06:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/using-shellexecute-to-open-mxd-win-7/m-p/283707#M7307</guid>
      <dc:creator>RichardWatson</dc:creator>
      <dc:date>2011-03-31T15:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using ShellExecute to open .mxd - Win 7</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/using-shellexecute-to-open-mxd-win-7/m-p/283708#M7308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;wow, shell... old school&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;windows 7 structures program files differently as well as user folders... (x86 for starters)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;so USERNAME is going to be a different path...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As richard states, should work, try throwing the MXD is a simple folder path to test.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 02:18:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/using-shellexecute-to-open-mxd-win-7/m-p/283708#M7308</guid>
      <dc:creator>MichaelRobb</dc:creator>
      <dc:date>2011-04-01T02:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using ShellExecute to open .mxd - Win 7</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/using-shellexecute-to-open-mxd-win-7/m-p/283709#M7309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This works for me using the process class instead.&amp;nbsp; I do not include the ".mxd" in my mapName variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;System.Diagnostics.Process arcmap = new System.Diagnostics.Process();

arcmap.StartInfo.FileName = arcmappath + "\\arcmap.exe";
arcmap.StartInfo.Arguments = path + mapName;

arcmap.Start();&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:43:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/using-shellexecute-to-open-mxd-win-7/m-p/283709#M7309</guid>
      <dc:creator>JoeMadrigal</dc:creator>
      <dc:date>2021-12-11T13:43:37Z</dc:date>
    </item>
  </channel>
</rss>

