Ibland är det jobbigt att begära admin rättigheter på bat filer så i stället frågar den efter det själv ;) så är det bara o trycka ja ^^ All cred till snubben som skrev koden<br /><br />[code]<br />@echo off<br /><br />:: BatchGotAdmin<br />:-------------------------------------<br />REM&nbsp; --&gt; Check for permissions<br />&gt;nul 2&gt;&amp;1 &quot;%SYSTEMROOT%\system32\cacls.exe&quot; &quot;%SYSTEMROOT%\system32\config\system&quot;<br /><br />REM --&gt; If error flag set, we do not have admin.<br />if &#039;%errorlevel%&#039; NEQ &#039;0&#039; (<br />&nbsp; &nbsp; echo Requesting administrative privileges...<br />&nbsp; &nbsp; goto UACPrompt<br />) else ( goto gotAdmin )<br /><br />:UACPrompt<br />&nbsp; &nbsp; echo Set UAC = CreateObject^(&quot;Shell.Application&quot;^) &gt; &quot;%temp%\getadmin.vbs&quot;<br />&nbsp; &nbsp; set params = %*:&quot;=&quot;&quot;<br />&nbsp; &nbsp; echo UAC.ShellExecute &quot;cmd.exe&quot;, &quot;/c %~s0 %params%&quot;, &quot;&quot;, &quot;runas&quot;, 1 &gt;&gt; &quot;%temp%\getadmin.vbs&quot;<br /><br />&nbsp; &nbsp; &quot;%temp%\getadmin.vbs&quot;<br />&nbsp; &nbsp; del &quot;%temp%\getadmin.vbs&quot;<br />&nbsp; &nbsp; exit /B<br /><br />:gotAdmin<br />&nbsp; &nbsp; pushd &quot;%CD%&quot;<br />&nbsp; &nbsp; CD /D &quot;%~dp0&quot;<br />:--------------------------------------<br />[/code]