Albert Dorelien
Albert Dorelien

Reputation:

I need help executing a bat file from asp.net 2.0

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!

Upvotes: 2

Views: 2317

Answers (3)

Josh Hinman
Josh Hinman

Reputation: 6805

I had a similar problem:

C#.Net: Why is my Process.Start() 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

Upvotes: 2

Pseudo Masochist
Pseudo Masochist

Reputation: 1927

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

Upvotes: 1

GEOCHET
GEOCHET

Reputation: 21323

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

Upvotes: -2

Related Questions