Jump to content

Run exe without admin rights


 Share

Recommended Posts

Hi there! Hope someone could help me. Would be much appreciated. 
Ive searched alot but could not find anything. The only thing i found was this _RunWithReducedPrivileges, but seams oudated.


So i have a autoit file that meant to start a exe file.

Simply has this code:
Run("newfile.exe")

Iam currently logged in as a user with Admin rights.

However i want to run the "newfile.exe" without admin rights. I want it to be runned as a limited, lower level user. 
 

Anyone has any idea? Is it even possible through autoit, or do i need do do it trough a cmd command ?

Thanks in advance! ❤️

Link to comment
Share on other sites

6 hours ago, Dracil said:

However i want to run the "newfile.exe" without admin rights. I want it to be runned as a limited, lower level user. 

Seems almost too obvious, but maybe you have overlooked the following :

Run an external program under the context of a different user : RunAs / RunAsWait

Edited by Musashi

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

my crystal ball shows the OP is running the AutoIt script with elevated permissions, and that script needs to run another process not elevated. there are several ways to do that, one of which is the _RunWithReducedPrivileges which works just fine for me.

then again, my crystal ball may be broken... ah, if only there was a way to make the OP describe his purpose more clearly. i'm certain there is a simple way to achieve whatever purpose he has in mind.

 

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

  • 3 years later...

The suggested methods are invalid or broken. That's why I want to revive the topic.
If you want to run exe file without admin rights in autoit code using #RequireAdmin, this can help you:

ShellExecute ( @WindowsDir & "\explorer.exe", "/select, " & $target)

Example:

#RequireAdmin
$target="C:\Windows\System32\mspaint.exe"
ShellExecute($target)
MsgBox(262144,"Run exe with admin rights","For example the drag and drop feature does not work")

Sleep(500)

$targetPath=StringLeft($target, StringInStr($target, "\", 0, -1) - 1) 
ShellExecute ( @WindowsDir & '\explorer.exe', "/select, " & $target ,@WorkingDir,Default,@SW_HIDE)
WinWaitActive($targetPath)
Sleep(500)
Send("{ENTER}")
MsgBox(262144,"Run exe without admin rights","For example, drag and drop feature can be used")

As a result, you can select it in Windows Explorer and run it manually.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...