I have given all permissions to IIS.
I will take your words. The code also seems okay to me.
Do you see any error entry in the event log? Try putting the code in
block and log the exception in the catch block. This would probably let you know why the code is not executing.
Additionally you may also check the link below,
Google search - run batch file on server asp.net