Skip to content

Instantly share code, notes, and snippets.

@kbandla
Created November 1, 2022 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbandla/efec3804e95b5fdda3e43db1eb386963 to your computer and use it in GitHub Desktop.
Save kbandla/efec3804e95b5fdda3e43db1eb386963 to your computer and use it in GitHub Desktop.
Command line scripts for Windows
msiexec /a %1 /qb TARGETDIR=%2
:: https://superuser.com/questions/171917/force-a-program-to-run-without-administrator-privileges-or-uac
:: @kbandla
@echo off
IF "%1%"=="" (
echo [!] Error: Need full path to the program. Aborting.
) else (
echo [*] Copied AppData path to clipboard
echo %LOCALAPPDATA% | clip
cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" %1"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment