views:

1010

answers:

4

I have an web application using asp.net 2.0 and vb.net I wrote a bat file to use GPG to encryt a file and call it whithin asp.net shell(pathname & filename). when I double click on the bat file from cmd windows it works fine but when I call it in the application everything command that I pass is executed perfectly except the gpg command. I make sure the user under which the application is running as all rights and privileges to run the commands I import, trust and verify all the keys and in fact the bat file works fine when double click on it but why it did successfully execute the GPG function. It did not return any error just did not encrypt any file

gpg -e --always-trust -r <> Filename

any help will be appreciated.

Thank you!

A: 

Not sure how you are using 'shell()' but Process.Start is the way to go.

Geoffrey Chetwood
A: 

Have you tried fully qualifying the path to the gpg executable in your batch file?

Pseudo Masochist
+1  A: 

I had a similar problem:

http://stackoverflow.com/questions/34183/cnet-why-is-my-processstart-hanging

It seems that Microsoft, in all their infinite wisdom, has blocked batch files from being executed by IIS in Windows Server 2003. Brenden Tompkins has a work-around here:

http://codebetter.com/blogs/brendan.tompkins/archive/2004/05/13/13484.aspx

Josh Hinman
A: 

I tried Brendan Tompkins approach -- which use the process,start -- with same result. What I do not understand is that the bat file did execute I have a couple of command in it like to rename a file and move the file into an archivve directory. All the commands in the batch file get execute except for the GPG command and it is not an user right issue because when login into the web server as the user under whom the application is running and click on the bat file all the command are executed.