Jump to content

run as admin


Recommended Posts

Hi.

I want run my exe file as administrator after finished installing Windows. I call it with this command in SetupComplete.cmd ("%~dp0Setup.exe"), but after run don't work correctly because need run as admin. how can run it as admin?

Please Guide me.

THANKS

Edited by behdadsoft
Link to comment
Share on other sites


runas /user:administrator /savecred "%~dp0Setup.exe"

runas /user:%username% /savecred "%~dp0Setup.exe"

runas /user:%computername%\%username% /savecred cmd

runas /user:%computername%\%username% /savecred "%~dp0Setup.exe"

PowerShell -Command (New-Object -com 'Shell.Application').ShellExecute('"%~dp0\Setup.exe', '', 'runas')

oder run batfile to drag &drop %1

PowerShell -Command (New-Object -com 'Shell.Application').ShellExecute('Cmd.exe', '/c \"\"%userprofile%\\Desktop\\Nuova cartella (2)\\mybatfile.bat\" \"%1\"\" ', '', 'runas')

PowerShell -Command (New-Object -com 'Shell.Application').ShellExecute('%userprofile%\\Desktop\\Nuova cartella (2)\\mybatfile.bat', ' \"%1\" ', '', 'runas')

Edited by odar
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
  • Recently Browsing   0 members

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