Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. /*
  2. this script is ran on the visual C++ 2008 Express Edition
  3. if you want to run on vs 2017, you have to change "Char" to TCHAR
  4. */
  5.  
  6. #include <stdio.h>
  7. #include <Windows.h>
  8. #define BUFFERLEN 100
  9.  
  10. int main()
  11. {
  12. char command[BUFFERLEN] = "%SystemRoot%\\notepad.exe";
  13. char Dst[BUFFERLEN] = {0,};
  14.  
  15. printf("%s\n",command);
  16. int r = ExpandEnvironmentStringsA(command, Dst, BUFFERLEN);
  17.  
  18. if(!r)
  19. printf("Failed\n");
  20. else
  21. printf("%s\n",Dst);
  22.  
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement