2

I'm trying to start an exe from the command line

shell> wampmanager

When I do that, a User Account Control popup pops up and prompts me for permission. I press "yes" to run and it runs. But is it possible to grant permission via the command line? This is because I am writing a batch file that runs this program on its own, and I won't be around to press the "yes" button when it does. Thank you.

0

2 Answers 2

3

This annoyed me as well, and some time ago I found a solution (don't know where).

  • Open Task Scheduler (type "Task" in the windows search bar)
  • Click on "Task Scheduler Library"
  • In the list in the center right-click and select "Create New Task..."
  • Give it a name, and maybe a description (might be convenient for later)
  • Near the bottom, select "Run with highest privileges"
  • At the bottom select "Configure for" > [your operating system]
  • On the "Actions" tab click on "New..."
  • Click browse and point to the .exe you want, and click "Ok"
  • On the "Conditions" tab, deselect everything
  • On the "Settings" tab, deselect everything but "Allow task to be run on demand"
  • On that same "Settings" tab, set the bottom option to your preference ("Do not start a new instance" is what you need for WAMP)

  • Next, for example on your desktop, right-click and select "New" > "Shortcut"

  • Enter following for location: C:\Windows\System32\schtasks.exe /run /TN "[taskname]", where taskname is the name you entered when you created the task. For example: C:\Windows\System32\schtasks.exe /run /TN "WAMP"
  • Give it a name
  • Optionally, you can change the icon in the properties.

Now you can put this icon in the Startup folder, and have for example WAMP start on startup. This is how I've been doing it for over a year, and no problems yet. Hope this works for you too ;)

1
  • Followed to a 't'. Works like FM! That's F Magic!
    – ejbytes
    Jan 31, 2016 at 0:32
1

1st try to RUN the Command Prompt as "Administrator" then run your script or whatever! or Disable the UAC by SlideDown to "Never Notify" then you can RUN anything without an Administrator issue

or if you're running a Batch file just Right Click and Run as Admininitrator

enter image description here

Not the answer you're looking for? Browse other questions tagged .