Skip to content

Instantly share code, notes, and snippets.

@khurata2
Created March 28, 2021 02:15
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 khurata2/794e4aa0e96c0479a72e49777f96c2bd to your computer and use it in GitHub Desktop.
Save khurata2/794e4aa0e96c0479a72e49777f96c2bd to your computer and use it in GitHub Desktop.
HTA Launcher for Windows 10
/* MSHTA launcher */
#include <windows.h>
#include <stdio.h>
int main(
int argc,
char * argv[]
) {
STARTUPINFO sinf;
PROCESS_INFORMATION pinf;
BOOL bResult;
char com_str[ 1000 ];
if ( argc < 2 ) {
return 1;
}
sprintf( com_str, "C:\\Windows\\System32\\mshta.exe \"%s\"", argv[ 1 ] );
GetStartupinf( &sinf );
bResult = CreateProcess( 0, com_str, 0, 0, FALSE, 0, 0, 0, &sinf, &pinf );
if ( !bResult ) {
return 1;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment