When you are a local user in windows you will face with the picture 1 when you want to run any program as administrator.
picture 1.
Now the solution is setting the
target in desktop icon like this using this code:
C:\Windows\System32\cmd.exe /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" "C:\Program Files\SAP\SAP Business One\SAP Business One.exe""
Just that run the icon again and should be work.
Explanation of code:
command that runs SAP Business One with specific settings in Windows Command Prompt (cmd.exe). Here's a breakdown of what it does:
C:\Windows\System32\cmd.exe: This is calling the Windows Command Prompt, the built-in command-line interpreter for Windows.
/min: This option minimizes the Command Prompt window when it runs.
/C: This tells the Command Prompt to run the command that follows and then terminate.
set __COMPAT_LAYER=RUNASINVOKER:
__COMPAT_LAYER
is an environment variable in Windows that allows you to specify compatibility settings for programs.- Setting it to
RUNASINVOKER
forces the program to run with the privileges of the current user, even if it's designed to require elevated (administrator) privileges. It bypasses the usual User Account Control (UAC) prompt that asks for admin permissions.
start "" "C:\Program Files\SAP\SAP Business One\SAP Business One.exe":
start
is used to run a new instance of a program or script.- The empty quotation marks (
""
) are required to set the title for the new window. If omitted, it could cause issues. "C:\Program Files\SAP\SAP Business One\SAP Business One.exe"
is the path to the executable file for SAP Business One. This is the program being launched.
Summary:
This command runs SAP Business One without requiring administrative privileges (due to RUNASINVOKER
), minimizes the Command Prompt window, and terminates it once the program starts.
This is useful when you want to avoid UAC prompts or need to run SAP Business One with regular user permissions.
Comentarios
Publicar un comentario