Jump to content

Recommended Posts

Posted (edited)

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

Posted (edited)

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

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