<?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: Are it possible to run an CMD files as Administrator as default ? in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/are-it-possible-to-run-an-cmd-files-as-administrator-as-default/m-p/9832593#M117447</link>
    <description>&lt;P&gt;I'm not aware of a way to make cmd files run as admin by default. But there is a trick to have a cmd file run it self as admin.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code below will create a temporary vbs script that will run the cmd file with admin permissions. You just have to add your code to the payload section where noted.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;@Anonymous&lt;/a&gt; off

if _%1_==_payload_  goto :payload

:getadmin
    echo %~nx0: elevating self
    set vbs=%temp%\getadmin.vbs
    echo Set UAC = CreateObject^("Shell.Application"^)                &amp;gt;&amp;gt; "%vbs%"
    echo UAC.ShellExecute "%~s0", "payload %~sdp0 %*", "", "runas", 1 &amp;gt;&amp;gt; "%vbs%"
    "%temp%\getadmin.vbs"
    del "%temp%\getadmin.vbs"
goto :eof

:payload
  echo %~nx0: running payload with parameters:
  echo %*
  echo ---------------------------------------------------
  cd /d %2
  shift
  shift

echo PUT YOUR CODE HERE

goto :eof&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Oct 2020 15:12:48 GMT</pubDate>
    <dc:creator>pball</dc:creator>
    <dc:date>2020-10-29T15:12:48Z</dc:date>
    <item>
      <title>Are it possible to run an CMD files as Administrator as default ?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/are-it-possible-to-run-an-cmd-files-as-administrator-as-default/m-p/9832562#M117446</link>
      <description>&lt;P&gt;I am working&amp;nbsp; on an system that would make it possible to full an new standard setup to the user in sekund. I might be able to do it fullautomation. but I would like to come it possible for the users to control it... but the cmd I have program need to be run as Admin .... it is possible to do that local if you know how ... but i would like to double click the files wait 2 sekunden and now you have all the update to your setting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;today I have a lot of running around form computer to computer. If I make an change .. like add new special design tool , VBA code , and Copy design rules... or give the users speciel setup search to My Search Folders&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there a way to do that&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 15:00:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/are-it-possible-to-run-an-cmd-files-as-administrator-as-default/m-p/9832562#M117446</guid>
      <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
      <dc:date>2020-10-29T15:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Are it possible to run an CMD files as Administrator as default ?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/are-it-possible-to-run-an-cmd-files-as-administrator-as-default/m-p/9832593#M117447</link>
      <description>&lt;P&gt;I'm not aware of a way to make cmd files run as admin by default. But there is a trick to have a cmd file run it self as admin.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code below will create a temporary vbs script that will run the cmd file with admin permissions. You just have to add your code to the payload section where noted.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;@Anonymous&lt;/a&gt; off

if _%1_==_payload_  goto :payload

:getadmin
    echo %~nx0: elevating self
    set vbs=%temp%\getadmin.vbs
    echo Set UAC = CreateObject^("Shell.Application"^)                &amp;gt;&amp;gt; "%vbs%"
    echo UAC.ShellExecute "%~s0", "payload %~sdp0 %*", "", "runas", 1 &amp;gt;&amp;gt; "%vbs%"
    "%temp%\getadmin.vbs"
    del "%temp%\getadmin.vbs"
goto :eof

:payload
  echo %~nx0: running payload with parameters:
  echo %*
  echo ---------------------------------------------------
  cd /d %2
  shift
  shift

echo PUT YOUR CODE HERE

goto :eof&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 15:12:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/are-it-possible-to-run-an-cmd-files-as-administrator-as-default/m-p/9832593#M117447</guid>
      <dc:creator>pball</dc:creator>
      <dc:date>2020-10-29T15:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Are it possible to run an CMD files as Administrator as default ?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/are-it-possible-to-run-an-cmd-files-as-administrator-as-default/m-p/9833958#M117479</link>
      <description>&lt;P&gt;I am not sure I understand your code very well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I not missing somthing ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it seens to me that I would need an file call&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%temp%\getadmin.vbs&lt;/PRE&gt;&lt;P&gt;I do not have it ... does your code not delete this file ,after first time use?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know a liltte programming ... but I am no master at all..so it may only be a lag of skill form my part .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but you are right on one thing.. I only need to get that one files to run as administrator(admin).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 05:59:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/are-it-possible-to-run-an-cmd-files-as-administrator-as-default/m-p/9833958#M117479</guid>
      <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
      <dc:date>2020-10-30T05:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Are it possible to run an CMD files as Administrator as default ?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/are-it-possible-to-run-an-cmd-files-as-administrator-as-default/m-p/9839904#M117541</link>
      <description>&lt;P&gt;That script automatically creates, runs, and then deletes the referenced vbs file. You do not need to do anything with that.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2020 13:18:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/are-it-possible-to-run-an-cmd-files-as-administrator-as-default/m-p/9839904#M117541</guid>
      <dc:creator>pball</dc:creator>
      <dc:date>2020-11-02T13:18:14Z</dc:date>
    </item>
  </channel>
</rss>

