Guest User

Untitled

a guest
Jan 8th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. char* executeMount(char* password, char* path, int unmountOrMount)
  2. {
  3. char* catString = new char[(strlen("echo|set /p password=") + strlen(password) + strlen(" | runas /user:administrator "mountvol ") + strlen(path) + 1)];
  4. strcpy(catString, "echo|set /p password=");
  5. strcat(catString, password);
  6. strcat(catString, " | runas /user:administrator "mountvol ");
  7. strcat(catString, path);
  8. //Equivalent command: system("echo|set /p password=" + adminPassword + " | runas /user:administrator mountvol" + path);
  9. return catString;
  10. }
Add Comment
Please, Sign In to add comment