May 5, 201313 yr 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 May 5, 201313 yr by behdadsoft
May 5, 201313 yr Author I add set __COMPAT_LAYER=RunAsInvoker command in the begining of batch file, But don't work.
May 5, 201313 yr disable UAC (set EnableLUA to 0) install all programs, in the last step activate UAC again and reboot Windows.
May 8, 201313 yr runas /user:administrator /savecred "%~dp0Setup.exe"runas /user:%username% /savecred "%~dp0Setup.exe"runas /user:%computername%\%username% /savecred cmdrunas /user:%computername%\%username% /savecred "%~dp0Setup.exe"PowerShell -Command (New-Object -com 'Shell.Application').ShellExecute('"%~dp0\Setup.exe', '', 'runas')oder run batfile to drag &drop %1PowerShell -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 May 9, 201313 yr by odar
Create an account or sign in to comment