Guest User

Untitled

a guest
May 26th, 2018
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. psexec -u USERNAME -p PASSWORD -i 0 -d c:pathtoprogram.exe
  2.  
  3. choco install --yes cygwin
  4.  
  5. choco install --yes nssm
  6.  
  7. name='Phone Home'
  8. command='C:Program FilesPython35python.exe'
  9. arguments='phone_home.py -p 3389'
  10. start_in='C:UsersETDropboxsrc' # Edit this shared code have it sync'd via Dropbox FTW!
  11. domain='.'
  12. username='ET'
  13. password='Use SSH and reverse port forwarding!'
  14. description='Launch Phone Home script at startup for real, not at log on. (Because this machine is headless, and how are you supposed to log in before it phones home?)'
  15. display_name="00 $name" # make it sort to the top in Services
  16.  
  17. nssm stop "$name"
  18. nssm remove "$name" confirm
  19. nssm install "$name" "$command" $arguments
  20. nssm set "$name" AppDirectory "$start_in"
  21. nssm set "$name" DisplayName "$display_name"
  22. nssm set "$name" ObjectName "$domain\$username" "$password"
  23. nssm set "$name" Description "$description"
  24. nssm start "$name"
  25.  
  26. source create_service.sh
Add Comment
Please, Sign In to add comment