-2

I have a "conf.bat" file which is set path so that I need to run as admin but I do not want create shortcut. I want to do in bat file by using command?

I want to run as bat file by run as admin I can do using command prompt. When I click bat file, It is run admin.

echo off
SETX /M PATH "<new path>;%PATH%"
goto son
:hata
@echo "Error conf.bat <Java dll>"
exit /B 1
:son
dincer.unal
  • 67
  • 1
  • 2
  • 13
  • 2
    Possible duplicate of [How to open an elevated cmd using command line for Windows?](http://stackoverflow.com/questions/19098101/how-to-open-an-elevated-cmd-using-command-line-for-windows) – RB. Jun 06 '16 at 13:44
  • No It is not duplicate because I want to run as bat file by run as admin I can do using command prompt. When I click bat file, It is run admin. – dincer.unal Jun 06 '16 at 13:49

1 Answers1

0

The only possible way that will fulfil your want is to use bat_to_exe converter (1.2Mb) that converts your batch file to exe and then you can right click and run as administrator.
Also you can add administrator manifest to your exe!! Using winch you don't have to right click and run as Administrator every time.

You can also use Iexpress.exe that is preinstalled on your PC. (Its confusing and not that efficient)

Rishav
  • 3,818
  • 1
  • 31
  • 49