ssh email@example.com "firewall external off R1 ; apply force ; quit"
is still prompting for a password.
Must be it doesn't know where the private key is, as I was able to tell Putty where it is.
I assume that you have the ssh command under Windows. Please refer to your Windows documentation to know where to put the SSH private key and in which format. Maybe at the C:\Users\<username>\.ssh\id_rsa location and in OpenSSH format?
I don't know how it should be under Windows but under Linux the private key should be readable/writable only by its owner (<username> here). Otherwise it won't work!
putty.exe -ssh -load CacheGuard -m "C:\CacheGuard\FtpOff.txt" -t
firewall external off FTP21 ; apply force ; quit
Where FTP21 is an external rule.
The command line above is now in BlockFtp.bat and I've changed "Off" to "On" above, for UnblockFtp.bat.
These bat files are now called from Scheduled Tasks to achieve the availability of our FTP Server only during office hours.
Job done, I hope
Thanks again David.