[Unit]
Description=Run mycommand at shutdown
Requires=network.target
DefaultDependencies=no
Before=shutdown.target reboot.target
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/true
ExecStop=unmount_disk_command
[Install]
WantedBy=multi-user.target
PsExec.exe -s -d -i 2 c:\temp\MyServer MyConsoleApp.exe