RM using a Windows Service

Richard Stockley pocketnerd at gmail.com
Fri Mar 13 19:04:37 EST 2009


Hi, I am trying to run an "rm" using SSH, from a Windows Service using the
following command line arguments - the aim is to clear the target folder
before i SFTP new files to it so that the two folders are then identical.



-o BatchMode=yes -o StrictHostkeyChecking=no -o -i C:\uat_key -l USERNAME
MACHINE rm -f /targetfolder/*



If I run this from a Windows EXE or Console application everything works
fine and the folder is cleared and my SFTP copies the new files over.
However, when I run it from the Windows Service the files are deleted but
the SSH process doesn’t actually end and therefore my application hangs and
the SFTP never happens.


Can you tell me why this would be the case for the Windows Service version
and ideally how i can get it to work?

Alternatively, can you tell me how i can clear the target folder before i do
my SFTP?

Many thanks

RS


More information about the openssh-unix-dev mailing list