metalx1000

Windows Hide Window CMD Shell Command

May 9th, 2020
1,044
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. // C++ program to open a URL in browser.
  2. // This program is written on for Microsoft
  3. // Windows OS
  4.  
  5. #include <windows.h>
  6.    
  7. int main()
  8. {
  9.     //List of Window options here
  10.     //https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showwindow
  11.    
  12.     //Open Website in Browser
  13.     char url[100] = "http://filmsbykris.com/";
  14.     ShellExecute(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL);
  15.  
  16.     //hidden CMD Shell Command
  17.     ShellExecute(NULL, "cmd", url, NULL, NULL, SW_MAXIMIZE);
  18.     ShellExecute(NULL, "open", "cmd", "/c tree c:\\ > log.txt", NULL, SW_HIDE);
  19.  
  20.     return 0;
  21. }
Add Comment
Please, Sign In to add comment