Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

knockando

Resolved

I wish I could tell you how I fixed this but I can't, I rebuilt the project and re-installed the service and everything is working now. -permissions works as expected.
knockando

-Permission Switch Through Process() in Windows Service

I have an windows service that uses WinSCP to put/get files through Dim winscp As Process = New Process() method. Almost exactly like you posted at https://winscp.net/eng/docs/guide_dotnet#vbnet_example

I recently had a request to be able to set permission on the files during the transfer so I'm implemented the -permissions=664. This worked fine as long as I was running my app local stepping through the code or typing in the commands on WinSCP.com. But when I install the service the permissions do not get set on the file. The service is running under a user account that is a member of the Administrator group on the server.

Example: put -permissions=664 D:\myFile.log /remoteDir/

I don't get any errors or messages when running this above command through the Dim winscp As Process = New Process() method, the file transfers fine, but the permissions do not get set.

Other than this everything is working great!
Any idea?