Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- psexec -u USERNAME -p PASSWORD -i 0 -d c:pathtoprogram.exe
- choco install --yes cygwin
- choco install --yes nssm
- name='Phone Home'
- command='C:Program FilesPython35python.exe'
- arguments='phone_home.py -p 3389'
- start_in='C:UsersETDropboxsrc' # Edit this shared code have it sync'd via Dropbox FTW!
- domain='.'
- username='ET'
- password='Use SSH and reverse port forwarding!'
- 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?)'
- display_name="00 $name" # make it sort to the top in Services
- nssm stop "$name"
- nssm remove "$name" confirm
- nssm install "$name" "$command" $arguments
- nssm set "$name" AppDirectory "$start_in"
- nssm set "$name" DisplayName "$display_name"
- nssm set "$name" ObjectName "$domain\$username" "$password"
- nssm set "$name" Description "$description"
- nssm start "$name"
- source create_service.sh
Add Comment
Please, Sign In to add comment